Skip to main content

Full text of "mit :: ctss :: CTSS ProgrammersGuide Dec69"

See other formats


The Compatible Time-Sharing System 

A Programmer's Guide 



The Compatible Time-Sharing System 

A Programmer's Guide 



SECOND EDITION 

The M. I.T. Computation Center 
p. A. Crisman, Editor 



The M. I.T. Press 

Massachusetts Institute of Technology 
Cambridge, Massachusetts 



Copyright © 1965 

by 

The Massachusetts Institute of Technology 

All rights reserved. This book may not be reproduced, in whole 

or in part, in any form (except by reviewers for the public press), 

without written permission from the publishers. 



Library of Congress Catalog Card Number: 65-25206 
Printed in the United States of America 



EBEFACE TO THE SECOND EDITION 2/66 1 



This second edition represents a major revision and 
extension of the first edition and is necessitated by the 
continuous evolution af the Compatible Tine-Sharing System 
(CTSS) over the past two years of operation. As CTSS has 
baan improved in reliability and capacity, since the suamer 
and fall of 1963, it has been implemented at both the 
Computation Center and Project MAC. Both installations 

oparate as a community service, seven days a week, 
twenty- four hours a day with the MAC computer being 
tima-shared full time and the Computation Center computer 
being time-shared about half of the time. At present, over 
110 consoles are scattered throughout the MIT campus, at New 
England colleges, and in the homes of several Project MAC 
participants. As a result, the two installations have had 
extensive experience with a broad spectrum of users. 
Therefore, it is no longer a question of the feasibility of 
a tima -sharing system, but rather a question of how useful a 
system can be produced. 

Daring these two years of growth, there have been frequent 
:;hangas of hardware configuration. Over seven different 

varieties of terminals have been attached to the system 
(threa are obsolete now) and several different drum and disk 
configurations have been used. Because of the programming 
interface design, most of these changes have been insulated 
from the average system user. Despite the numerous hardware 
changes it has become increasingly obvious that the essence 
of a useful time-sharing system lies in the programming, 
i.e., in the software, and not in the hardware. 

The programming has grown from a skeletal form of perhaps 
50,000 instructions to an estimated size of between tOOyOOO 
and 1,000,000 words cf publicly-available system program. 
From the few languages which were first available, the 
system also has evolved to presently contain over a dozen 
languages. Much of this growth in both words and in 
languages is the work of many users rather than of system 
programmers. In fact, it has been a goal to enhance and 
simplify the process of sub-system writing by supplying a 
framework that is highly modular and which encourages 
iivision of responsibility and initiative. 

Many of the ideas described in this manual were mentioned in 
the first edition but at that time had not been implemented. 
In addition, several key features have been introduced to 
make a more complete system. A brief list of some of these 
features, which are detailed more completely within this 
manual, are: password logic, introduction of more elaborate 
accounting procedures, inter-console message, public files, 
ani macro commands. Further details of the system design 
and implementation are given in Project MAC Technical Report 
No. 16 by J. Saltzec. A summary of system operational 



PREFACE 10 THE SECOHD EDITIOS 2/66 2 

experience is given by R. Fano in Project MAC Technical 
Raport No. 12 (AC-609-296) and is also published as an 
article in the January 1965 issue of the IEEE Spectrun. 

Two major features have been introduced into the system 
which deserve special coBment. First, the entire secondary 
storage laechanisn! has been redesigned. This is considered 
to be the most significant and far reaching change because 

and the controlled sharing of files on the part of user. 
Tha design and implementation of this critical section has 
been led by Robert Daley. 

The second major new feature is the improved message 
coordination with the typewriter terminals. This feature, 
while not obvious to users, has greatly improved the 
organization and operation of the supervisor program. The 

work in this important and critical area has been done by 
Stanley Dunten who also has been instrumental in maintaining 
affective system operation. 

Tha present manual is considered a part of the system 
because it is maintained on-line within the system, and it 
rapresants an attempt to keep all system documentation 
continuously up to date. As system users know, 

iocumantation difficulties have been severe, with over 80 
bulletins and numerous research memoranda prepared and 
circulated as amendments to the first edition of the manual. 

The effect of the present manual is that an active system 
usar can keep his manual updated. To do this, he should 
periodically inspect a special table of contents of the 
manual, which is maintained on-line within the system in 
reverse chronological order of ,chantes that have been made 
to the various sectio.nJs. ■ F torn' this special table of 
contents, he can juicklyclet.eraine which sections have been 
revised since the last time he Updated his copy, and then 
obtain on-line printouts of those sections he needs. 
Needless to say, the procedures of requesting appropriate 
sections by mail or in person will still fee available. In 

any case, the need for maintaining a massive mailing list 
for amendments to the manual is eliminated. 

Ackngw ledgeggnts 

In addition to the previously-mentioned critical work of 
preparing the present system by Robert Daley and Stanley 
Dunten, the system owes its present form to an ever 
increasing number of staff members and contributors. Other 
-nn *-ri h.fi*nrc! *■ '^ ■»■ Vua c: yd- am nrrv ni- ama in q app. a 1 ohabe t ica 11 VI 
Janet Allen, nichael Bailey, Robert Creasy, Patricia 
Crisman, Marjorie Daggett, Daniel Edwards, Robert Fenichel, 
Charles Garman, Robert Sraham, Thomas Hastings, Jessica 
flallwig, Lyndalee Korn , Richard Orenstein, Louis Pouzin, 



PREFACE 10 THE SECOND EDITICS 2/66 3 

Glenda schroeder and Mary Hagner. In addition, 

contributions of some of the commands have been made by 
Margaret Child, Leola Odland, Don Oppert, and Jerome 
Saltzsr. Many of the subroutine write-ups which served as 
rafsrance documents far the present system were prepared by 
o-m-h frii"<=»" Tii/^i*-h <;ra11. and Susan Sorinaer. 

A great deal of the present system's impact upon users has 
baan because of its reasonably continuous and reliable 
service. To a large extend, this has been due to the great 
zaal and perservecence of the Computation Center's 
operational staff, who have conscientiously dealt with the 
many problems which have arisen. 

Wa wish to thank the Computation Center and Project MAC 
alministration for contributing the proper environment and 
shouldering the many problems which have been generated. 
Thay have made possible the present system's high level of 
development. 

Thanks are also due to the maintenance personnel of the 
Intarnational Business Machines Corporation and of the New 
England Telephone and Telegraph Company for their diligent 
afforts in maintaining a high level of system performance. 

A special acknowledgement goes to the Advance Besearch 
Projects Agency of the Department of Defense, and the Office 
of Naval Research, the sponsors of Project MAC, and the 
National Science Foundation, for the support of some of the 
special eguipment at the Computation Center. 

F.J. Cor bat o 

Hay 1965 

Cambridge, Massachusetts 



EBEFACE TO THE FIRST EDITIOH Page 1 



This handbook is an attempt to document the techniques of 
using a current version (model 13) of the compatible 
tima-sharing-system (CISS) which has been developed at the 
MIT Computation Center. It is primarily a manual of how to 
us3 tha'^system, in contrast to many of the research memos, 
which have been more detailed in their documentation of the 
techniques of implementation. Because CTSS is basically a 
system which will allow an evolutionary developnent of 
time-sharing while continuing to allow more conventional 
background systems to operate, it is expected that the 
present manual will of necessity be revised many times 
bafora it reaches a final form. A good deal of the 

difficulty arises from, en the one hand, the rather drastic 
rhanga in user operating techniques which time-sharing 
permits, and on the other hand the immense amount of 
programming required to fully implement the system. 

The present work, although net highly polished, is being 
prasented now to assist in this evolutionary process. It is 
expected to be a supplement to the Computation Center's 
Pro~3iurss Handbo3k rfhich explains naany of the general 
administrative details of the Center. Furthermore, a 

knowladge of nrDgr amniiiig is assumed of the reader. It has 
been our objective to present to an experienced programmer a 
raasonably complete manual which will allow him to use 
wisely the present version of the time-sharing system. 

BacausB of the rapidity with which many of the features are 
being implemented, and the delays in distributing the 
inavitable revisiDns, some features are described here which 
are not yet accomplished. The reason for this is that it 
was fait to be important to indicate the intended scope and 
objectives of the system so that individual users could plan 
ahaad in their applications. The features which are not 
implemented will be found listed in an appendix which will 
be revised periodically. In addition, each of the chapters 
can be expected to be periodically revised. 

Sinca the present work is primarily a handbook, no attempt 
has been made to make any comparisons with the several other 
tima-sharing and remote-console efforts which are being 
developed by groups else- where. The only other general 

purpose time-sharing system known to be operating presently, 
that of the Bolt, Beranek and Mewman Corporation for the 
POP- 1 computer, was recently described by Professor John 
McCarthy at the 1963 Spring Joint Computer Conference. 
Other time-sharing developments are being made at the 
Carnegia Institute of Technology with a G20 computer, at the 
University of California at Berkeley with a 7090, at the 
Rand Corporation with Johnniac, and at MIT (by Professor 
Dennis) with a PDP- 1 . Several systems resemble our own in 
thair logical organization; they include the independently 



PREFACE TO THE FIRST EDITION Page 2 

developed BBN system for the PDP-1, the recently initiated 

work at IBM (by A. Kinslow) on the 7090 computer, and the 

plans ot tne sysxein ue vexutjffieut v-wL^/wva vj.^» -^ -„ ,__ 

computer . 

To establish the context of the present worJt, it is 

iafoj-mative to trace the development of time-sharing at MIT. 

Shortly after the first paper on time-shared computers, by 

C Strachay at the June 1959 UNESCO Information Processing 

Conference,' H«M. Teager and J. McCarthy at MIT delivered an 

unpublished paper "Time-Shared Program Testing" at the 

August 1959 ACM Meeting. Evolving from this start, much of 

tha tima-sharing philDSophy embodied in the CTSS system has 

been developed in conjunction with an MIT preliminary study 

committee (initiated in 1960), and a subsequent working 

-ommittee. The work of the former committee resulted, xn 

April 1961, in an unpublished (but widely circulated) 

internal report. Time-sharing was advocated by J. McCarthy 

in his lecture, given at MIT, contained in "Management and 

tha Computer of the Future" (MIT, 1962), Further study of 

the design and inple mentation of man-computer interaction 

system is being continued by a recently organized 

institute-wide project under the direction of Professor 

Robart M. Fano. In Sovember 1961 an experimental 

tima-sharing system, which was an early version of CTSS, was 

demonstrated at MIT, and in May 1962 a paper describing it 

was delivered at the Spring Joint Computer Conference. 

As might be expected, the detailed design and implementation 
of the present CTSS system is largely a team effort with the 
major portions of it being prepared by the following: Mrs. 
Majorie M. Daggett, Mr. Robert Daley, Mr. Robert Creasy, 
Mrs. Jessica Hellwig, Mr. Richard Orenstein, and Professor 
F.J. Corbato. Important contributions to some of the 

commands and the background system has been offered by 
Professor Jack Dennis, Mr. J.R. Steinberg, and members of 
the Computation Center Staff. Mrs. Leslie Lowry, Mr. Louis 
Pouzin, and Mrs. Evelyn Dow have contributed to the 
preparation of the commands. 

Special credit is given to Professor Herbert Teager for the 
lasign and development of his Flexowriter control subchannel 
which allowed the original experimental version of the 
present system to be developed, tested, and evaluated; only 
with such an opportunity was it possible to have the 
confidence to make the present pilot development of the CTSS 
system. 

Wa should also like to extend our thanks to the Computer 
Center of the University of Michigan where Professor Bernard 
Siller, «r. Bruce Arden", and Mr. 'Robert Graham have been 
very helpful in advising us en the use of their Mad Compiler 
in our time-sharing system. In addition, Mr. Robert Rosin 
kindly made available the Madtran editing program for 



EBEFACE 10 THE FIRST EDITICN Page 



processing Fortran II subprograms to Had subprograms. 

W3 should further like to take this occasion to acknowledge 
partial support by the National Science Foundation, the 
Office of Naval Research, and the Ford Foundation, of the 
iavalopment of 3ur present system. We also add our 
appreciation for the support provided the Computation Center 
by tha IBM Corporation. 

Finally, we should like to encourage the readers cf this 
handbook to examine the present system with a view toward 
improvaments and we shall welcome such criticisms. 

F.J. Cor bat o 
Cambridge, Massachusetts 

May 1963 



L.Xi>i) tttuvj Kflnn EH'3 \3U xi>r. 



0«;^(.XUU LtlDUCi 






lAELE OF CONTENTS (12/31/69) 
{♦ denotes file system section) 



Preface to the Second Edition 

AA, Introduction to Time Sharing 
.0 Introduction 

.1 General description and usage techniques 
.2 "Time -Sharing Primer" 
.01 File na me £ 



2/66 



12/69 
12/69 
12/69 



AB. Documentation 

.1 Conventions for this manual 
.2 Glossary and conventions 
.3 System documentation 

AC. Hardware 

. Equipment configuration 

.1 Clocks 

.2 Consoles and character sets 

.01 Character sets 

.02 Special characters 
.3 Data phone extensions 

AD. Files 

.1 Historic file system 

*.2 A new look in the file system 

.3 Library files 

.4 CoBmon files and Pufclic File 

.5 Time accounting files 

AE. File Editing (off-line) 

,1 Bulk input and output 
.2 DAEHOM 

.01 Retrieval 

AF. Background 

.1 Bestrictions for background programs 

AG. Subroutines 

AG.O Supervisor entries: Reference list 



AG. 1 Console I/O 

.01 BDFLX,HDFLXA,HeFLX, 

WRFLXA,RSSBB 
.02 SETFUL,SETBCD,SETIICV 
.03 PBNTP,PBNTPA, PBNTPC 
.04 HBMESS,BDMESS, ALLOW, 

FOBEID 



General I/O 

Character mode 
Fenced output 
Inter-program 
communication 



12/69 
12/69 
05/66 



12/69 



12/69 
12/69 
12/69 



09/65 
12/69 
11/65 
12/69 
12/69 



12/69 
12/69 

12/69 

12/69 

12/69 
06/69 



CTSS EBCGRAMMEH»S GUIDE 



Section TABLE 



12/69 



05 



06 

.07 

.08 
,09 
.10 
, 11 
.12 
, 13 



A1TC0N,RELSAS,SNDLIN, 
3 N DLN A, R EBL IN , R DL IN A, 
cT ft v" <;r Tf< - «;r T 1 ? 

(CSH) ,. BEAD, .READL, 
.LOOK,.SCRDS 

(SPH) , (SPHM) ,.PfiIHT, 
. COMNr,.SPRMI 

,PCOHI 

. PRSLT,, PRBCD,. PROCT 

,HDATA, =RPDTA 

SErhiBK,KILIIBK 

PaMESS,PHMESA 

PB12,PR12A 

PRFULL,PRFULA 



AG. 2 Disk 
.01 

.02 



03 

.04 
.05 
.06 

.07 

08 



.09 
«.1C 

*- 11 



File I/O 

. LOAD,. DUMP,DSKLOD, 

DSKDMP 
SEEK,. READK, ENDRD, 

B-D-VREAD 
ASSIGN, .WHITE, FILE, 

APPEND,B-D-V-FHRITE 
.RELRW 

SETVBF 



Slave remote consoles 



WAD, Fortran online 
input coapatibility 

RAD, Fortran online 
output compatibility 

EAD print comnent 

BAD print results 

BAD read data 

No- break mode 

Print message 

Print message in 12-bit 

Print message in 12-bit 



Unbuffered I/O 

(old library) 
Buffered input 

(old library) 
Buffered output 

(old library) 
Relative read/write 

(old library) 
Set fixed record length 

(old library) 
Library service 

(old library) 
Zero file (old library) 
File System disk I/O 



SRCH,BLK,FLK,ENDF, 

CLOur 

.CLEAR 

OPEN, BUFFER, RCFILE, 

RDWAIT, SRFILE,WRWAIT, 

rRFILE,FCHECK,FHAIT, 

CLOSE ,SETPRI 
LCFIL 
BFOPES,BFREAD ,BFHRIT, 

BFCLOS,BFCODE 
Old file system wr it e- arounds to new system 



Load file into free core 
Buffered input/output 



12/69 

08/65 
08/65 



08/65 
06/69 
06/69 
06/69 
06/69 



11/65 
11/65 
11/65 
11/65 

11/65 

11/65 
12/66 

1/66 
12/69 



AG. 3 File Status 

.01 CHMODE, RENAME 

.02 DELETE, ERASE 

.03 COflFIL,rSSFIL,USRFIL 

.Q^ FSTAT,.FSTAT 

.05 GTNAM 

.06 .RESET, RESETF 

*.C7 CHFILE,DELFIL, UPDATE 
FSTArE,SrORGE 



Change mode 
Delete file 
Switch file 
File status 



or name 

directory 
(old library) 



Get file name in series 
Drop files froi active 

status 
Change mode or name, 

delete, find status 



AG.U Errors and Exits 

,0 1 Historic file system error procedure 

Library disk 
procedure 



.02 SETERR, SNAP, RECOUP 



error 



11/65 
11/65 
06/69 



11/65 
12/66 

09/65 



t-iii fKuvanHnncK • :j la uiua 



aaCJXlOIl IRDUC 



I // D':^ 



.03 E0FXI1,SETE0F ,WRDCNT 

.04 EXIT,EXITM,CLKOUT, 

ENDJOB,EUMP,PDU«P 
.05 LDOMP 

* HA irnvi^-hn podd^u nowptpo 

PBDIAG 

AG. 5 Tapes and Pseud o tapes 

.01 .PDNCH,.PNCHL,.TAPWR, 

(SCB) , (STH) , (STHM) 
.02 .TAPBD, (TSH) , (TSHH) 
.03 (STB) , (rSE) , (HLH) , (HLR) 
.04 .BSF,.BSH,.EFI,.R«T, 
(BST) , (EFT), (BBT) 
♦.05 MOUNT, UMODNT, VERIFY, 
LABEL, TAPFIL 



AG. 6 



Pre 


gcao Status 


.01 


DEAD, EOBMNI, GET ILC, 




FNRTN 


,02 


SLEEP, WATT 


.03 


GEIBRK,SETBRK,SAVBRK 


.04 


STOMAP 


.05 


-SETOP, (FPT) , (EFTM) , 




(LFIM) 


.06 


GEIHEW,SETHEM,GWBM, 




sn£n,BXHEn 


.07 


FREE, FRER, FRET 


.08 


TILOCK 


.09 


GETBOF 



AG. 7 Supervisoz 

.01 GETLOC,GEIAR¥,SETLOC, 

GL0C,SL03,SYPAR 
.02 GETCF,3ETCFN 
*.03 UEDMFB, DELMFE, ATTACH, 
ALLOT, HOVFIL, LINK, 
UHLIMK,SETFIL,RSFILE 
♦.04 ATTHAM 
.05 WBOAMI 
.06 COMLOC,S MATCH, SAC, 

ACOBE 
.07 SETHRCGETHRE 
.08 SETBLP,GETBLP 
.09 ISIH 

AG. 8 Connands and Sabsystem Contr 
.CO General Discussion of Ha 
.01 XECOM,HEXCOH,NCOM 
-02 SCHAIH 
.03 CHNCOM, (GET, G,SET,S) 



Library end-of-file 

procedure 
Terminal procedure 09/65 

Error exit for math 

routines 
File systeni error 12/69 

procedure 



Write BCD with format 08/65 

Read BCD with foraat 09/65 

Read/write binary 
Backspace, rewind, 

write end of file 
I/O system tapes for 12/69 

foreground 



Dead and domant status 12/69 

Alarm clock 12/69 

Intarrupt level 
Storage map 
Floating point trap 

Memory bound 09/65 

Free storage management 
File-wait return 05/66 

Get buffer from free 12/69 

core 

Supervisor parameters 12/69 

Current comfil number 12/69 

Privileged I/O system 12/69 

calls 

Attached directory 12/69 

User information 12/69 

Named items in 06/69 

supervisor 
User A-core word 12/69 

Timing response 12/69 

Line number of logged- 12/69 
in user 

ol 

cro commands 
Single commands 
General Macro command 
Supervisor command chain 



CTSS PROGRAMMER'S 3UIDE 



Secrtion TABLE 



12/69 4 



3LS and ZLC 
04 GETCOM, COMABG 
.05 SETOPT,RSOPT,LDOPT, 

G£rOPT,SETSYS, GETSYS 



control 
Coannand argunent 
Cptions and subsystem 

control 



12/69 



AG. 9 Debugging 
.01 ERROR 



Subroutine trace 



AG. 10 



Conversion 



02 
.03 

.04 

.05 

.06 
,07 
,08 
.09 
,10 

, 11 
.12 
,13 



DEFBC,DELEC, DEHBC 
OCABC ,OCDBC: ,OCLBC , 

OCBEC 
BZEL,ZEL,LaUS'I,RJUST 

(lOH) , (RTN) ,(FIL) , 

IOHSIZ,SrQUO 
PAKR,P&KL,UNPAKR,UHPAKL 
PINT, MINT 
COM, OR A, ANA 
DICODE, ENCODE 
DTBC,OrBC,BTDC, BTOC 

PAD,BZL,NZL,ZEL,NBL 
ADJ,LJ,BJ 

BZ57 



BCD or 


spi 


csad- 


oct 


al 


to b: 


Lna; 


cy 






Binary 


to 


BCD 






Binary 


to 


spce 


sad- 


•octal 



Justification and 

padding 
Format conversion 

Pack and unpack words 
Fortran integers 

complement, OR, AND 09/65 

Format coovecsion 03/66 

Binary to octal or BCD 12/69 

conversion 

Padding 12/69 

Justification 12/69 

Null zeroes, blanks 12/69 



AG. 11 Subroutine Linkage Processing 



.01 COLi:,SELAR,MDL 

.02 GNAM 

,0 3 M0V£1,ttOV12,MO7E3 

,04 SErFMT,SETNAB 



Variable-length calling 

sequence 
Type of calling seguence 
Move argument list 

Forsaat and file name 



AG. 12 Timers 

.01 GEIIME, GBTTM, GTDYTM 
.02 TIMER, JOBTM,RSCLCK, 

STOPCL,KILLTB,TIWLFT, 
RSTRTN 
. 3 CLOCOS, CLOCOF, UPCLOC 
.04 RDYTIM 



Current date and time 05/66 

Alarm clock, stop watch 



Simulated interval timer 12/69 
Print time used 12/69 



AG. 13 Miscellaneous 

.00 List of miscellaneous library subroutines 02/66 

.01 (FPT) Floating point overflow 08/65 

and underflow 



AH. Commands 



& H 



T nrt rt 1 nn 

— - 3 ^ - •• 3 



.01 LOGIN Log in 

.02 LOGOUT, ENDLOG ,0T0L03 Log out. 



automatic 



12/69 
12/69 



CTSS EBCGBAMM£fi«3 GUIDE 



Section TABLE 



12/69 5 



.03 FIB,DELFIfl,PRFIB 

.04 TIPEEK 

.05 DIAL 

.06 HELLO 

AH. 2 Languages and Subsystems 

.01 AED 

.02 BEFAP 

.03 COGO-90 

.04 COHIT 

.05 DYNAMO 

.06 ESL Display System 

.07 FAP 

.08 GPSS 

.09 LISP 

.10 MAD 

.11 MA&IBM 

.12 SMOBOL 

.15 OPS 

.16 TIP 

.17 F0S4 

.18 FOBMAC 

-19 .,HHITE 

AH. 3 File Creation and Editing 

.02 ED 

.03 SAVE,HyS&¥E 

.04 SAVFIL, RERON 

*.05 LINK, UHLINK, PERMIT, 

♦.06 MOUNT, UMOONT, VERIFY, 
LABEL, TAPFIL 

.07 EDL 

.08 EDB 



logout 
Foreground Initiated 
Background 



12/69 



Tine and disk quotas 


12/69 


Attach renote console 


12/69 


Dialup message 


12/69 


ALGOL Extended for 


02/66 


Design 




Bell Laboratories 7094 




Assembler 




Coordinate Geometry 




Language 




String Processing 


09/66 


Language 




eodel Simulation 




Language 




ESL Display System 




IBM 7094 Assembler 


12/69 


General Purpose System 




Simulator 




List Processing 


02/66 


Language 




Michigan Algorithm 


08/65 


Decoder 




Fortran II to MAD 




translator 




String Manipulation 


05/66 


Language 




Online Programming 


01/66 


System 




Technical Information 


12/69 


Program 




Fortran IV to MAD 


03/66 


translator 




Desk Calculator 


03/66 


Command Interface 


12/69 


Context editor for 


12/69 


card- image files 




Save dormant program 


12/69 


Save and restore RUNCOH 




status and files 




Link to files in other 


12/69 


U.F.D.'s 




Tape-handling commands 


05/66 


Context editor for 


03/66 


line- marked files 




Context editor for 


12/69 



binary files 



CTSS PfiOGRAMMER'S GUIDE 



Section TABLE 



12/69 



AH. 4 



AH. 5 



.09 


QED 


.10 


EDA 


. 11 


MOVE, APND 


.12 


EDC 


File Compression 


.01 


AHCHIV 


.02 


CBUNCB 


.03 


SQOASH,XPANB 


.04 


SQZBSS,PADBSS 


.05 


AARCHV 


.06 


APEtiDA 


Fil 


e Printing 


.01 


LIS IF 


.02 


PBINTF 


.03 


FBiur 


.QH 


PRBIN 


.05 


PBBSS 


.06 


SDUMP 


.07 


PEIHrA 


.08 


P 



ErograiBinable editor 


06/69 


Context editor for 


12/69 


ASCII files 




Copy files 


12/69 


Context editor for 


12/69 


card- image files 





Archive seldom- used 06/69 

files 
Compress BCD files 

Line-mark, files 12/69 

Compress BSS files 12/69 

Archive ASCII files 06/69 

Append to Archives 12/69 



List file directory 06/69 
frint card -image file 

Print BCD file 01/66 

Erint binary file 06/69 

Summary of BSS file 11/65 

Erint SAVED file 01/66 

Print ASCII file 06/69 

High-speed print 06/69 



AH. 6 File Housekeeping 
.01 COMBIN 
.02 SPLIT 
.03 CHMODB, BEHAME, DELETE 



.014 


COMFIL,COPY,0PDATE 


.05 


EXrBSS,UPDBSS 


.06 


BCUEST 


.07 


CALL 


.08 


ATTACH 


.09 


APEBD 


. 10 


aCASCI 



Combine files 

Split files 

Change mode or name, 12/69 

delete file 

Common files 08/65 

Library file house- 11/65 

keeping 

Off-line processing 12/69 

File system call 09/66 

Attach to other U.F.D. 06/69 

Append to files 12/69 

Off-line ASCII printing 12/69 



AH. 7 Program Execution 

.01 LOAD,LOADGO,VLOAD, 

MCLOAD,L,USE 
.02 LDABS 
.03 STARr,RSrABT,HESTOH, 

RECALL, HESOBE ,R, 

CQIITIM 
.04 LAED,USE 

.05 DO 

.12 PLOAD 

.07 BLIP 



Belocatable program 05/66 

loading 
Absolute program loading 05/66 
Start or continue 05/66 

program execution 

Relocatable program 07/66 

loadi ng 
Load private command 12/69 

from common file 
Simulate loading; cross- i2/b9 

reference storage map 
Set execution timing 12/69 



t-x;>3 fKuvjKftnncK ' :> u uxuc 



SBUtiOll XAD1.C, 



i^/or* 



response 



AH.e 



.08 


RUN 


TIP Utility dispatchii 


Deb 


ugging 




.00 


Genecal discussion o 


f debugging tools 


.01 


FAPDBG 


Symbolic PAP language 
debugger 


.02 


HADBUG 


HAD language debugger 


. 03 


PH 


Post fflorteo dump 


.04 


PATCH, 3rOpAT,TRA 


Relocatable progran 
patching 


.05 


S PATCH 


SAVED file patching 


.06 


SD,SP 


Supervisor dumping an( 
patching 


.07 


SIR ACE 


Subroutine trace 


.08 


DEBUG 


Symbolic debugging 


.09 


STOH&P 


Storage map 



12/69 



09/65 
09/65 



06/69 
12/69 



AH. 9 Document 

.01 TyPSET,HU80FF 
.03 REMARK 

.05 MAIL 
.06 ROFP 
.07 PIMFO 

AH. 10 Command Execution 
,01 BUNC0M,CHAIM 
.02 GENCOH 
.03 SOBSYS 
.04 OPTIOM 



Memo editor, printer 
Send message to systems 

staff 
Send message to users 
Print ASCII aeaos 
Online documentation 

of new changes 

Macro command 
Octal arguments 
Subsystem control 
User options 



12/69 
08/65 

02/66 

06/69 
06/69 



12/69 
08/65 
12/69 
12/69 



AH. 11 Miscellaneous 


.01 


PBHIEB 


.02 


WHO 


.03 


SPACE, EJECT 


.04 


ECHO 


.05 


OCT, DEC 


.06 


POII,POFF 


.07 


BED, BLACK 


.08 


YES 


.09 


iAIT 


.10 


TIME 


.11 


P ERROR 



AI. Public File Subroutines 
AI.O General 

AI.2 Input/Output 

.01 MADIO,REAE,PRINT 



File error diagnostic 
List current users of 

CTSS 
Listing control 
Print command line 
Octal/decimal conversion 
Turn printer on and off 
Change ribbon color 
Command chain checkpoint 
pause between commands 
Print date and time 
Explain file error code 



03/66 
12/69 

12/69 
12/69 
12/69 
12/69 
12/69 
12/69 
12/69 
12/69 
12/69 



05/66 



Compressed I/O routines 09/66 



CTSS PBOGRAMMEB'S 3UIDE Section TABLE 12/69 8 

AJ . Public File Comuands 

AJ.C General 12/69 

AJ.2 Languages and Subsystems 

.02 GEM General Purpose 02/66 

Macrogenerator 
.03 EPS EguilibriuB Probleia 03/66 

Solver 
Aj.4 File Cjuipression 

.01 SQZBCD,PADBCD Compress BCD files 07/66 



AJ.5 File Printing 

.02 DISPLY Text display on ESL 03/66 

scope 

.03 LSILNK List links in U.F.D. 07/66 

.04 OCTLF List U.F. D.in octal 02/66 

.05 TAPLF List tape files 09/66 

AJ.6 File Housekeeping 

.01 61012 Convert 6-bit to 12-bit 08/65 

.02 APPEND Combine line- marked 08/65 

files 

.03 ENCIPH, DECIPH Garble files 09/65 

.04 CMPABE Compare two files 12/69 

.05 12106 Convert 12-bit to 6-bit 12/69 

AJ.8 Debugging 

.02 SBCH search SAVED file 08/65 

.03 DUMPEB Dump SAVED file 09/66 

A J. 10 Command Execution 

.01 QUES Check success of BUNCOH 08/65 

.03 BUNPRT Identify BUNCOM para- 11/65 

meters 

AJ.11 Miscellaneous 

.01 SLAVE Slave remote consoles 08/65 

AK . Sample programs 

AK.C General 12/69 

AK . 8 Commands and Subsystem Control 

.01 Usage of subsystem facility 12/69 

INDEX to Subroutines and Commands 12/69 

(END) 



rTc;c; cRpnRaMMRR'^ nwrrif 



•Zori- i nn TH DRY 



1 :> yAQ 



SUBROUTINES 



IMCEX (12/31/69) 



(BST) 


AG. 


5.oa 


.8PDTA 


AG. 


1.10 


DECODE 


AG. 


10,09 


(CSH) 


AG. 


1.06 


. BUT 


AG. 


5.04 


DEFBC 


AG. 


10.02 


( EFT) 


AG. 


5.04 


.scaos 


AG. 


1.06 


DELBC 


AG. 


10.02 


(EFTM) 


AG. 


6.05 


.SEEK 


AG. 


2,02 


DELETE 


AG, 


3.02 


(FIL) 


AG. 


10.05 


.SETUP 


AG. 


6.05 


DELFIL 


AG. 


3.07 


(FPT) 


AG. 


6.05 


.SPIRNT 


AG. 


1.07 


DELMFD 


AG. 


7.03 


(FPT) 


AG. 


13.01 


.TAPED 


AS. 


5.02 


DERBC 


AG. 


10. 02 


(I OH) 


AG. 


10.05 


.TAPWB 


AG. 


5.01 


DORMNT 


AS. 


6.0 1 


(L FTM ) 


AG. 


6.05 


. URITE 


AG. 


2.0 3 


DREAD 


AG. 


2.02 


(BLR) 


AG. 


5.03 


A CORE 


AG- 


7.06 


DSKDMP 


AG. 


2.01 


(RTN) 


AG. 


10.05 


ADJ 


A3 . 


10. 12 


DSKLOD 


A3. 


2.01 


(RWT) 


AG. 


5.0U 


ALLOT 


AG. 


7.03 


DTBC 


AG, 


10. 10 


(SCH) 


AG. 


5.01 


ALLOW 


AG. 


1.04 


DUMP 


AG, 


4,04 


(SPH) 


AG. 


1.07 


ANA 


AG. 


10.08 


DWRITE 


AG, 


2.03 


(SPHM) 


AG. 


1.07 


ASSIGN 


AG. 


2.03 


ENCODE 


AG, 


10,09 


(STB) 


AG. 


5.03 


ATTACH 


AG. 


7.03 


ENDF 


AG. 


2,06 


(STH) 


AG. 


5.01 


ATT CON 


AG. 


1,05 


ENDJOB 


AG, 


4.04 


(STHM) 


AG, 


5.01 


ATTNAM 


A3, 


7.04 


ENDRD 


AG, 


2.02 


(TSB) 


AG. 


5.0 3 


ECCEC 


AG. 


10.01 


EOFXIT 


AG. 


4.03 


(TSH) 


AG. 


5.02 


BCOCT 


AS. 


10.01 


ERASE 


AS. 


3.02 


(TSHM) 


AG. 


5.02 


BFCLOS 


AG. 


2.10 


EfiRGR 


AG, 


9-01 


(WLR) 


AG. 


5.03 


BFCODE 


AG. 


2, 10 


EXIT 


A3 . 


4.04 


. ASIGN 


AG. 


2.03 


BFOPER 


AG. 


2.10 


EXITM 


AG. 


4.04 


.BSF 


AG. 


5.04 


BFBEAD 


AG. 


2. 10 


EXMEM 


AG. 


6.06 


.BSR 


AG. 


5.oa 


BF KBIT 


A3. 


2.10 


FCHECK 


AG. 


2.08 


.CLEAR 


AG. 


2.07 


BLK 


AG. 


2.06 


FEHRTN 


AS. 


4.06 


.COMMT 


AG. 


1.07 


BREAD 


AG. 


2.02 


FILE 


AG, 


2,03 


.DUMP 


AG. 


2.01 


ETEC 


AG. 


10,10 


FINT 


AG. 


10,07 


.EFT 


AG. 


5.04 


BIOC 


AG. 


10, 10 


FLK 


AG. 


2,06 


.EMDRD 


AG. 


2.02 


BUFFER 


AS. 


2,08 


PNRTN 


AG. 


6,01 


.FILE 


AG. 


2.03 


BHBIIE 


AG. 


2,03 


FORBID 


AG. 


1,04 


.FSTAT 


AG. 


3.04 


BZEL 


AS. 


10.04 


FBEE 


AG. 


6.07 


.LOAD 


AG. 


2.0 1 


BZL 


AG. 


10. 11 


FRER 


AG. 


6.07 


.L03K 


AG. 


1.06 


CHFILE 


AS. 


3.07 


FRET 


AG. 


6.07 


.PCOMT 


AG. 


1.08 


CHHODE 


AG. 


3.01 


FSTAT 


A3. 


3.04 


.PNCHL 


AG. 


5.01 


CHNCOH 


AS. 


8.03 


FSTATE 


AG. 


3.07 


.PRBCD 


AG. 


1.09 


CLKOOr 


AG. 


4.04 


FWAIT 


AG. 


2.08 


.PRINT 


AG, 


1.07 


CLOCOF 


AS. 


12.03 


FWRITE 


AG. 


2.03 


. PHOCT 


AG. 


1.09 


CLOCON 


AG. 


12.03 


GAC 


AG, 


7.06 


- PRS LT 


AG. 


1.09 


CLOSE 


AG, 


2.08 


GCLC 


AG. 


8,03 


.PUHCR 


AG. 


5.01 


CLOUT 


AG. 


2.06 


GCLS 


AG- 


8.03 


. BDATA 


AG. 


1. 10 


COLT 


AG. 


11.01 


GETARY 


AG. 


7.01 


• READ 


AG. 


1.06 


COH 


AS. 


10.08 


GETBLP 


AG. 


7.08 


.HEADK 


AG. 


2.02 


COHABG 


AG. 


8.04 


GETBRK 


AG, 


6,03 


.REAOL 


AG. 


1.06 


COMF1 L 


AG. 


3.03 


GETBUF 


AG, 


6.09 


. SELHH 


AG. 


2.04 


COMLOC 


AG. 


7.06 


GETCF 


AS, 


7.02 


•RESET 


AG. 


3.06 


DEAD 


AG. 


6.01 


GETCFS 


AG, 


7.02 



CrSS PRC^ RAMMER'S GMTDE 



Section IMDEX 



12/69 



GETCLC All. 3,0 3 

GETCLS AG. 8.0 3 

3ETC0M AG. 8.04 

GETILC AG. 6.0 1 

GETIME AG, 12.01 

3ETL0C AG. 7.0 1 

GETMEM AG. 6.06 

GliTQFI AG, 8,05 

GETSYS AG. 8.05 

3ETTM AG. 12.01 

GETWRD AG. 7.07 

GLOC AG. 7.01 

GMEM AG. 6.06 

GNAM AG. 11.02 

GTDYTM AG. 12.01 

Gi'NAM AG. 3.05 

lODIAG AG. 4.06 

IJHSIZ AG. 10.05 

ISIN AG. 7. 09 

JOBIM AG, 12,02 

KILLTR AG. 12.02 

KILNBK AG. 1.11 

LABEL AG. 5.05 

LDFIL AG. 2.09 

LDOPT AG. 8.05 

LDUMF AG. 4.05 

LINK AG. 7.03 

LJ AG. 10. 12 

LJUST AG.1C.04 

MDL AG. 11. 01 

MINT AG. 10.07 

MOUNT AG. 5.05 

M0VE1 AG. 1 1.03 

.^,3VE2 AG.11.Q3 

M0VE3 AG. 11.03 

MDVFIL AG. 7.03 

NBL AG. 10. 11 

MCOM AG. 8.01 

NEXCOM AG. 8.01 

NZL AG. 10. 1 1 

aCABC AG.1C.03 

OCDBC AG. 10,03 

OCLBC AG,1C.03 

OCRBC AG. 10.03 

OPEN AG. 2.08 

ORA AG. 10.08 

OTBC AG. 10. 10 

PAD AG. 10. 1 1 

PAKL AG. 10,06 

PAKR AG. 10.06 



PDUMP AG. 4.04 

PR 12 AG. 1. 13 

PR CIA G AG. 4.06 

PRFULL AG. 1. 14 

PRMESS AG. 1.12 

PRMTEfi AG. 4.06 

PBNTP A3. 1.03 

nrFXfJf »r: > na 

RDFLX AS. 1.01 

HDLINA AG. 1.05 

HDMESS AG. 1.04 

RDWAIT AG, 2.08 

RDYriH AG. 12.04 

RECOUP AS. 4.02 

HEELIN AG. 1.05 

REL8AS AS. 1.05 

REMAME AG. 3,01 

RESET? AG. 3.06 

HJ AG, 10. 12 

HJUSr A3. 10.04 

aSCLCK A3. 12. 02 

BSPILE AG. 7.03 

RSOPT AG, 8.05 

8SSHB AG. 1,01 

RSIHTN AS. 12. 02 

SAVBRK AG, 6.03 

SCHAIN AG. 8.02 

SCLC AG. 8.03 

5CLS AG. 8.03 

SEEK AG. 2.02 

SELAR AG. 1 1.01 

SEI12 AS. 1.05 

SET6 AG. 1.05 

SEI3CD AG. 1.02 

SBTBLP AG. 7.08 

SBIBRK AG. 6.03 

SETCLC AG. 8.03 

SETCLS AG. 8,03 

SETEOF AS. 4.03 

SETERfi AG, 4,02 

SEIFIL AS, 7,03 

SETFMI AG, 11.04 

SETFUL AS. 1.02 

3ETL0C AG. 7.01 

SEIHEM AS. 6.06 

SETNAM AG. 11. 04 

SETNBK AG. 1.11 



SET3YS AS. 8,U5 

SETVBF AS. 2.05 

SETWRD AG. 7.07 

SLAVE AG. 1.05 

SLEEP AG. 6.02 

SL3C A3. 7.01 

SMEM AG. 6.06 



SNAP 


AG. 


4.02 


SNATCH 


AG, 


7,06 


SNDLIS 


AG, 


1.05 



SRCH AG, 2,06 

STCMAF AG, 6,04 

ST3PCL AS, 12. 02 

STORGE AG, 3,07 

STyUO AG. 10,05 

SYPAR AG, 7,01 

TAPFIL AG. 5.05 

TILOCK AG. 6.08 

TIKER AS. 12.02 

TIMLFT AS. 12.02 

TRFILE AG, 2.08 

ISSFIL AG. 3.03 

UHOUNT AG. 5.05 

UMLIHK AG. 7,03 

UNPAKL AG. 10.06 

UMPAKR AG. 10,06 

UPCLOC AG. 12.03 

UPDATE AG. 3.07 

UPDWFD AG. 7.03 

USRFIL AG. 3.03 

VERIFY AG. 5,05 

VREAD AG, 2.02 

VWRITE AG. 2.03 

WAIT AG, 6,02 

HHDAMI AG, 7,05 

MBDCNT AG, 4,03 

WRPILE AG, 2.08 

HRFLX A3. 1,01 

WRMESS AG. 1.0U 

WRWAII AS. 2,08 

XECOH AG. 8.01 

ZBL A3. 10. 11 

ZEL AG. 10.04 
BZ57 A3. 10. 13 

Public 



SETNCV 


AS. 


1.02 


MADIO 


AI. 


2.01 


SETOPT 


AS. 


8.05 


PRINT 


AI. 


2.01 


3 ET P R I 


AG. 


2.08 


READ 


AI. 


2.01 



CTSS FBOGRAMMES'S GUIDE 



Section INDEX 



12/69 



CDMMANDS 

AH. 2.19 

AARCHV AH. 4.05 

AED AH. 2.0! 

APEND AH. 6.09 

APENDA AH. 14.06 

APND AH, 3.11 

AHCHIV AH. U.0 1 

ATTACH AH- 6.08 

BRPAF AH. 2.02 

BLACK AH. 1 1.07 

BLIP AH. 7.07 

CALL AH. 6.07 

CHAIN AH. 10.01 

CHWODE AH. 6.03 

COGO AH. 2.03 

COMBIN AH. 6.01 

CDMFIL AH. 6.0U 

COMIT AH. 2.04 

CDMTIN AH. 7.03 

COPY AH. 6.04 

CKUNCH AH. 4.02 

DEBUG AH. 8.0b 

DEC AH. 11.05 

DELETE AH. 6.03 

DELFIB AH. 1.03 

DIAL AH. 1-05 

DO AH. 7.05 

DYNAMO AH. 2.05 

ECHO AH. 11.04 

ED AH. 3.02 

EDA AH. 3.10 

EDB AH. 3.08 

EDC AH. 3.12 

EDL AH. 3.07 

EJECT AH. 11.03 

ESL AH. 2.06 

EXTBSS AH. 6.05 

FAP AH. 2.07 

FAPDBG AH. 8.01 

FIB AH. 1.03 

F3H4 AH. 2. 17 

FORMAC AH. 2.18 

3ESC0W AH. 10.02 

GPSS AH, 2.08 

HELLO AH. 1.06 

L AH. 7.01 



LABEL AH. 3.06 

LAFD AH. 7-04 

LDABS AH. 7.02 

LINK AH. 3.05 

LISTF AH- 5.0 1 

LITHP AH. 2.09 

LOAD AH, 7.01 

LOADGO AH, 7.01 

LOGIN AH- 1.01 

LOGOUT AH. 1.0 2 

MAC AH. 2.10 

MADBUG AH. 8.02 

MADTHN AH. 2-11 

MAIL AH. 9.05 

MOUNT AH. 3.06 

M0¥£ AH. 3. n 

MYSAVE AH. 3.03 

NCLOAD AH. 7.01 

OCT AH. 11.05 

OPS AH. 2.15 

OPTION AH. 10.04 

P AH. 5.08 

PACBSS AH. 4.04 

PATCH AH. B.04 

PERMIT AH. 3.0 5 

PERROR AH. 11. 11 

PIHFO AH. 9.07 

PLOAD AH. 7,06 

PM AH. 8.03 

POFF AH. 1 1.06 

PON AH. 11. 06 

PREIN AH. 5.04 

PRESS AH. 5.05 

PHPIB AH. 1.03 

PRINT AH. 5.03 

PRINXA AH. 5,07 

PRINTF AH. 5.02 

PRNTER AH. 11. 01 

QED AH. 3.09 

B AH, 7.03 

RECALL AH. 7.03 

RED AH. 11.07 

REMARK AH. 9.03 

RENAME AH, 6.03 

RERUN AH. 3.04 



BESTOH AH. 7.03 

RESUME AH. 7.03 

REVOKE AH. 3.05 

fiCFF AH. 9.06 

BQASCI AH. 6.10 

■ HCUEST AH. 6.06 

R START AH. 7.03 

BON AH, 7.08 

RUNCOM AH. 10,01 

RUNOFF AH. 9.01 

SAVE AH. 3.03 

SAVFIL AH. 3.04 

SD AH. 8.06 

SDUMP AH, 5.06 

SNOBOL AH. 2. 12 

SP AH. 8.06 

SP AH. 11.03 

SPATCH AH. 8.05 

SPLIT AH. 6.02 

SQUASH AH. 4.03 

SQZBSS AH. 4.04 

START AH. 7.0 3 

ST3MAP AH. 6,09 

STOPAT AH. 8.04 

STRACE AH. 8.07 

SUBSIS AH. 10.03 

TAPFIL AH. 3.06 

TIME AH. 11. 10 

TIP AH. 2. 16 

THA AH, 8.04 

TTPEEK AH. 1.04 

TIPSET AH. 9.01 

UMOONT AH. 3.06 

ONLIMK AH. 3.05 

UPDBSS AH. 6.05 

USE AH. 7.01 

USE AH. 7.04 

VERIFY AH. 3,06 

VLOAD AH. 7,0 1 

WAIT AH. 11. 09 

WHO AH. 11.02 

WRITE AH. 2.19 

XPAMD AH. 4.03 

YES AH. 11. 08 



cri 


;S FHCGBAMMEB 


PUBLIC 






12X06 


AJ. 


6.05 


&r3 12 


AJ. 


6.01 


APPEND 


AJ. 


6.02 


C.I PARE 


AJ . 


6. 04 


DECIPH 


AJ. 


6.03 


DISPLX 


AJ. 


5.02 


DOMPEB 


AJ. 


8.03 


ENCIPH 


AJ. 


6.03 


EPS 


AJ . 


2.03 


GPM 


AJ. 


2.02 


LSTLNK 


AJ. 


5.03 


OCTLF 


AJ. 


5.04 


PADBCD 


AJ . 


4.01 


QUES 


AJ. 


10.01 


RUNPRT 


AJ. 


1C.03 


SLAVE 


AJ. 


11.0 1 


S2ZBCD 


AJ . 


4.01 


SRCH 


AJ. 


8.02 


TAPLP 


AJ. 


5.05 



•3 GU I D E 



Section INDEX 



12/69 4 



(END) 



CTSS PHCGRAMMER*5 GUIDE Section &A . Page 1 

I 5 en t if i cation 

Introduction to Tine-Sharing 

Time-sharing is an aabiguous term. Some people use this 
term to describe concurrent operation of several parts of a 
single computer. This . sort of operation, also called 

multiprograaning, generally is directed toward efficient 
utilization of hardware. 

Tha tima-sharing system described in this manual seeks to 
allow a somewhat different sort of efficiency. Although 

hardware utilization is still considered, the primary goal 
is concurrent, effective utilization of a single computer by 
several users. 

The motivation for time- shared computer usage arises out of 
tha slow man-computer interaction rate presently possible 
with the bigger, more advanced computers. This rate has 

changed little (and has become worse in some cases) in the 
last decade of widespread computer use. 

In part, this effect has been due to the fact that, as 
elementary problems become mastered on the computer, more 
complex problems immediately become of interest. As a 

result, larger and more complicated programs are written to 
tika advantage of larger and faster computers. This process 
inevitably leads to more programming errors and a longer 
pariod of time required for debugging. Using current batch 
processing techniques, as is done on most large computers, 
3ich program bug usually requires several hours to 
eliminate, if not a complete day. The only alternative 

available has been for the programmer to attempt to debug 
directly at the computer, a process which is grossly 
wasteful of computer time and hampered seriously by the poor 
console comaunicatijn usually available. Even if a 

typewriter is available at the console, there are usually 
lacking the sophisticated query and response programs which 
are vitally necessary to allow effective interaction. Thus, 
what is desired is drastically to increase the rate of 
interaction between the programmer and the computer without 
large economic loss and also to make each interaction more 
meaningful by extensive and complex system programming to 
assist in the man-computer communication. 

In addition to allowing the development of usable and 
sophisticated debugging techniques, an efficient 

time-sharing system should make feasible a number of 
ralitivaly new computer applications which can be 
implemented only at great cost in a conventional system. 
Any problem requiring a high degree of intermixture of 
computation and communication on a real-time basis should 
raaiily lend itself to time-sharing techniques. Examples of 
this type of application include: 



CTSS PROGRAMMER'S GOIDE Section AA.O Page 2 

dacLsion-tree pcoblens; real-time management 

problems (airline reservations, hospital administration, 

szz ,) ; gaiHiiiy pcuuxciua, j\j^j.uj.<j-j^^'^-m. — ~r ■^ — --» 

taaching machines; language learning problems; 
library retrieval; text-editing; algebra manipulators; 
and many more. 

Th3 Compatible rime-Sharing System (CTSS) is a 

general- purpose programming system whi=h allows a new form 
of computer "oparatiDn to evolve and yet allows most older 
programming systems to continue to be operated. CTSS is 

usai from consoles which may be of several varieties, but 
»hich in essence are electric typewriters. Each console 

usar controls the computer (i.e. as seen by him) by issuing 
standard commands, one at a time. The commands allow 

convenient performance of most of the routine programming 
oparations such as input, translation, loading, execution, 
stopping, and inspection of programs. This command 

convenience, although it has a fixed format, causes no loss 
of generality since a command can also be used to start an 
arbitrary programming subsystem with its own control 
language. 

Th2 consoles of CTSS communicate with the "foreground" 
system, by which computation is performed for the active 
-onsola users in variable length bursts, on a rotation 
basis, according to a scheduling algorithm. The 

"background" system is a conventional programming system 
(slightly edited for the time-sharing version) which, at the 
l^ast, operates whenever the "foreground" system is 
inactive, but which may also be scheduled for a greater 
portion of the computer time. The entire operation of the 
computer is under the control of a supervisor program which 
remains permanently in the 32,768 word A-bank of core 
mamory. When a user program is scheduled to be run, it is 
brought into the 32768- word B-bank of core memory (unless it 
is already there) from drum or disk memory. 

Not only are the drum and disks used for swapping of active 
user programs, but all console users utilize the disk memory 
for sa mi -permanent storage of their active program and data 
files. Cards and magnetic tapes still serve in secondary 
rolas as long-time and back-up storage devices. 



(EHD) 



CTSS PROGBAMHEB'S SDIDE Section AA. 1 12/69 1 

Identification 

:;3n3ral Descriptian and Usage Techniques 

Tha foreground system is organized around both •♦coanands", 
which are system programs accessible to all users, and the 
user's private program files. Both types of programs are 
stored on the disk, along with files of data, documentation, 
etc. For convenience, the disk files have titles with name 
and class designators. Files can be entered from consoles 
or cards, and they may be punched out at disk editing time. 

Th e_S UE er V isor 

The supervisor program remains in A-core at all times when 
CTSS is in operation. Its functions include; handling of 
ill input and output; scheduling; handling of temporary 
storage and recovery of programs during the scheduled 
swapping ; monitoring input and output performed by the 
background system; and performing the general role of 
monitor for all jobs. These tasks can be carried out by 
virtue of the supervisor's direct control of all trap 
interrupts, the most crucial of which is the one associated 
with the interval timer clock. 

The interval timer clock is set for small bursts of time, 
currently 2C0ms. Every clock burst allows the supervisor to 
interrupt the program currently running in B-core in order 
to interpret input from the consoles or to issue output to 
the consoles. If the input from a console is other than a 
break character, it is left in the supervisor's core 
buffers. Hhen a break character is encountered, the 

supervisor determines whether this is a line of input which 
has arrived early for one of the working programs or whether 
the status of one of the users should be changed; i.e., to 
working status or waiting command status. If the line was a 
command line, the user is placed in waiting command status 
so that the next time his turn arrives, the supervisor can 
load the command program as his working core image. 

The user programs are run for periods of time determined by 
the scheduling algorithm. At the end of each program's 
allotted time or if it changes status, the supervisor 
determines which user is to fce run next. It must then 

determine whether the program or programs currently in core 
must be dumped (to disk or dram), in part or entirely, to 
leave room in cere for the next user. The next user program 
must then be retrieved from secondary storage together with 
the proper machine conditions. 

In addition to maintaining input and output buffers for each 
user console, the supervisor keeps a record of the status of 
each user. The status of a user may fce: "working", where a 
program is ready to continue running whenever it is next 



CTSS EBCGBAMMEB'S GUIDE 



Section AA . 1 12/69 2 



brought in ; "waiting command", where the user has just 

completed a ccand line at his console; "input^wait" or 

^ ^ ^ ^^^ ^r-orTT-am ic; tPBDorarilv held up 

"output-wait", wiieLC 1-IIT3 t^^v^^- — . — '"'■ ^ *. u.,**^-; 

waiting for either a console line or a free output buffer. 
"Eile-2ait.., where the program is temporarily delayed until 
another user has finished using the requested file; I/O 
.^"°u» w-^t", where a program is delayed because an I/O 
device "(typically a 'tape) is busy or not yet ready; 
"timer- wait", -here the program has requested that it be 
a'layad for a specified time; "dormant", where the program 
h"as stopped running and returned control to the supervisor, 
but machine conditions and the status of memory are 
preserved for inspection, modification, or re-entry; and 
"a:-ad", where the program has terminated, control has been 
returned to the supervisor, and machine conditions and the 
status of memory have been scrapped. 

It should be noted that command programs are handled in 
exactly the same manner as the user's own programs, with 
r-spect to status and scheduling. The background system is 
also considered another user; at present it has a different 
place in the scheduling algorithm, with permanently lowest 
priority. In addition there is another type of background, 
consisting of background jobs initiated from consoles but 
l=*ft to run without console interaction; these ^obs are run 
with exactly the same type of scheduling as normal 
foreground programs. 

Command Format 



commands may be typed by dead or dormant users; they are 
intarpreted by the time-sharing supervisor (not by the user 
programs). They can thus he initiated at any time, 

'^ ^ ,, ' -i ^i._ „^ ^1.-; ^.iia r r^i-nnT-A m in m*»morv. (It is tor 



regardless of the particular program in memory. (It is 
similar reasons of coardinat ion, that the supervisor handles 
all input- output of the foreground system typewriters.) 
Commands are composed of fields separated by blanks; the 
first field is the command name, and the remaining tieias 
ar- parameters pertinent to the command. Each field consists 
of the last 6 characters typed "ost recently since the last 
blank (initially an implicit 6 blanks). A carriage return 
is the signal which initiates action on ^he command. 
Whenevar a command is received by the supervisor, "H t is 
typed back. When the command is completed, "R t1 + t2 is 
typed back. " H" is the abbreviation for WAIT; "B« for 
READY; "t" is the current time of day; "t1" is seconds 
spent in execution; and "t2" is seconds spent in swapping. 
A command may be abandoned at any stage, including during 
the typing of the command line or during command output, by 
nivina the "quit signal" peculiar to the console. 

A "command line" which ha s a dollar sign ($ ) as its fi>^st 
character will be treated as a comment and will not be 
ex ecuted. 



CTSS EBCGBAMMER'S GUIDE Section AA.1 12/69 3 



ComBand Initiation 

At the completion of a comniand line at a user's console, 
that user is placed in waitin g - command status. He is then 
set at the end of a scheduling queue which is chosen 
according to a rule assigning higher priority to shorter 
programs. When this user reaches the head of the 

highest-priority active queue, he will be placed into 
working status. 

When the user first reaches working status, the supervisor 
searches its comm an d directorj for an entry giving 
information about the command. There are three types of 
commands: 

!• A-COBE ^THAliSFE B - special supervisor functions, 

such as SAVE. A supervisor subroutine is executed 

in core A, and the user is restored to the state 
he was in before issuing the command. 

2. B-COBE-TBAjISFEB - cause the user's program to be 
started at'a^given location. These commands (USE, 
START, etc.) cause the message 

"ILLEGAL SEQDENCE OF COMMAMDS" 

to be typed if the user does not have a core image 
(i.e., if he is not in DORBAHT status) . 

3- DISK-LOADED - these commands are by far the most 
numerous. The program which is associated with 
("which performs") a given disk- loaded command 
resides in a disk file (of second name »TSSDC. • 
for system commands, 'SAVED* for user coimands) , 
in the system file directory or the user's own 
files (see AB.10.0U concerning private coBmands). 
When it is executed, a disk-loaded command becomes 
the user's core image. Some disk-loaded commands 
are "PBIVILEGEE" and may make supervisor calls 
which users are forbidden to make. 

If the command name is found in the command directory, the 
supervisor either: 

1. Executes the indicated A-core subroutine, and 
returns; 

2. causes the user's location counter to be set to 
the correct value, and places the user in working 
status; 

3. loads the indicated disk file as the user's 
program and starts the user at the beginning of 



CTSS PROGRAHMES'S GUIDE Section AA.1 12/69 U 

his new core image. 

If the conmand name is not found in the directory^ the 
suparvisor assumes that the command is an unprivileged 
disk-loaded conmand, and attempts to load a comaaDd file 
with first name the sane as the command name. If no such 
file exists, perhaps because the command name has been 
misspelled, the comment 

»name' NOT FOUNE. 

will be typed. In such a case, the user's core image and 
machine status are preserved. 

If the 200 's bit in the user's restriction code is on, he is 
a "restricted user" and nay not use any disk -loaded commands 
3xc3pt LCGIN and LOGOUT. That is, he may use only 

LOGIN, LOGOUT 

RESUME, HESTOR, COHIIS, BBCAIl, B 

SAVE, MYSAVE 

STAR I, R START 

USE, PM, STOPAT, TRA, PATCH, STRACE, PAPDBG 

All other commands issued by a restricted user will be "NOT 
FOUND". 

(For all practical purposes, such a user may only resume 
SAVED files, and the particular SAVED files in his directory 

datarmine conEletely what use he may make of the system.) 

If the 1000 bit in the user's restriction code is not on, he 
is a "subsystem-restricted" user. Such a user may net alter 
his standard options or fiubsystem trap status; his subsystem 
will have been initialized by LOGIN. His ability to use 
CTSS is determined by the subsystem. 

A foreground program terminates its activity by one of two 
maans. It can re-enter the supervisor in a way which 
eliminates the cere image and places the user in a dead 
status; alternatively, bj a different entry the program can 
ba placed in a dormant status (or be manually placed there 
by the user giving a quit signal). The dormant status 
differs from the dead status in that a dormant user may 
still restart or exa«ine his program. 

Usar input-output to each typewriter is via the supervisor, 
and evan though the supervisor has a few lines of buffer 
space available, it is possible for a program to become 
input-output limited. Consequently there is an injut-wait 



CTSS EBCGBAMHEB'S GUIDE Section AA,1 12/69 5 

status and an cut£Ut::wait status, into which the user 
program is autcuatically placed by the supervisor whenever 
input-output delays develop. When buffers becoine nearly 
empty on output cr nearly full on input, the user program is 
automatically returned to working status; thus waste of 
computer tiie is avoided. 

SchedulijDg 

In order to optimize the response time to a user's conmand 
or program, the supervisor Mses a multi-level scheduling 
algorithm. The basis of the algorithm is the assignnent of 
each program as it enters working or waiting command status 
to an nth level priority queue. Programs are initially 

=>nt=»red at a level which is a function of the program size 
U.e-» at present, programs of less than Uk words enter at 
l^v=»l 2 and longer ones enter at level 3). There are 

currently 9 levels (0-8). The process starts with the 

sup=»rvisor operating the program which is first in the queue 
at the lowest occupied level, L. The program executes for a 
time limit = 2.P.L quanta; a quantum of time is one half 
second. If the program has not finished (left working 
status) by the end of the time limit, it is placed at the 
end of the next higher level queue. The program at the bead 
of the lowest occupied level is then brought in. If a 

program E enters the system at a lower level than the 
program currently running, and if the current program Pi has 
run at least as long as P is allotted, then Pi will be 
returned to the head of its queue and P will be run. 

There are several different time limits whose current values 
may ba of interest to the users. If a data phone is dialed 
into the computer and the user does not log in within 2 
minutes, there is an automatic hangup. If a user stays in 
any non-working status for one hour, he is automatically 
logged out. The clock burst which enables the supervisor to 
housekeep the console input and output and to change program 
status is currently set to 200 ms. The quantum of time used 
in the scheduling algorithm is one-half second. 

Hemori_Protectioi!_and_Belocation 

To avoid fatal conflicts between the supervisor and aultiple 
users, the CTSS IBM 709a includes a special modification 
whi:;h bahavss as follows: 

Core memory is divided into 256-word blocks. There are two 
7-bit protection registers which, when the computer is m 
its normal mode, can be set by program to any block numbers. 
Whenever a user program is run, the supervisor, as a final 
step just before transferring to the user program, switches 
the computer to a special mode such that if reference to any 
memory address outside the range of the protection register 
blo^k numbsrs is attejpted, the normal mode is restored and 



CTSS PROGR&MMEa'S SUEDE Saction AA. 1 12/69 6 



a trap occurs to the supervisor. 

There is alsc a 7-bit relocation register Wuich saodifies 
avary memory reference, during execution, by addition of the 
relocation register block number. Thus programs which have 
baen interrupted by the supervisor may te moved about in 
memory, if necessary, with only the proper readjustment of 
tha ralocation register required. 

Finally, if the user program, while in the special mode, 
stiouia attempt to execute any instructions concerning 
input-output, changes in mode or core bank reference status, 
or resetting of the protection or relocation registers, the 
normal mode is restored and a trap occurs to the supervisor 
program in core bank A. Errors in this class are known 
generically as protection mode violations. 

Ms3r_Communication_with_the_SU£ervisor 

Tha supervisor perfDrms a number of control functions which 
may be directly requested by the user. These include: all 
input and output (e.g., disk, drum, consoles, tapes); 
requests for information about or extension of the user 
program memory allocation; simulation of floating point 
trap; control of each user's status, interrupt level, and 
input mode; and other functions which involve communication 
with, or control by, the supervisor. 

Since all protection violations cause a trap to the 
supervisor, users may conveniently communicate with the 
suparvisor by means of such violations. Before rejecting a 
protection violation as a user error, the supervisor checks 
tha possibility that it was caused by a user- program of the 
form 

TSX NAME1 ,U 



NAHE1 TIA =flNA«E 

whars MAKE is the BCE name of a legitimate supervisor entry 
point. The details of each supervisor entry are described 
in section AG. Ihe IIA instruction is described in IBM 
manual L22-6636; it nay usefully (but inexactly) be read as 
Trap Into A core . 



(END) 



CTSS PROGRAMHER'S GUIDE Saction AA.2 12/69 1 

"IIME-SHARIHS PRIMER" 

INTBODUCTIOM 

Beginnings ace most difficult. This is far more true 
than trite in regard tc the use of the Compatible 
Tima-Sharing System (3TSS) , which involves techniques that 
are liable to seem rather obscure even to experienced 
programmers. This document was designed, then, in order to 
facilitate the new CTSS user's transition from 

batch- processing orientations to a time-sharing orientation. 
It does not pretend ta offer "sophisticated'* information. 
Rather, it is intended to relieve the reader of the 
necessity of having ta worry about ferreting out — usually 
by word of mouth — the basic operational information which 
is prerequisite t3 sophistication. So, leaving only the 
details of becoming an accredited user through 

administrative channels, and of turning on and dialing in 
his particular console (see Section AC. 3) to the reader, we 
attempt to present here a ••toehold", a guide (including an 
annotated "script") to the new CTSS user for his first 
time-sharing console session. 

(The material herein is ba:^d upon "Soma Introductory 
Notes on Time-Sharing Console Usage Techniques for the 
Summer Programming Course," which was written as a reference 
for students taking the one week Basic Programming and FAP 
Courses, offered annually by the H.I.T. Computation Center; 
as such, it may have rather too pedantic a cast -- though 
one hopes that over-simplification is more informative than 
over- complication.) 

k Q.MHJL IjOQK at tibe-shabimg 

Sy s te m : 

Time-sharing is a system which allows a number of users 
to make use of a computer "at the sane time" for independent 
tasks. The technique is possible because of the large 
mismatch between computer speeds and human reaction times. 
Although the computer is actually sharing its attention 
among all of its users, it can be made to appear to each 
user as if he had control of the machine in its entirety. 
The program which regulates the process of co-ordinating 
activities (the CTSS Supervisor — or "the system") resides 
in a separate bank of core memory, and actually causes the 
various users' programs to be brought into a second bank of 
memory from other storage devices. 

Interaction: 



Each user really has physical control only over some 
remote input-output terminal, usually a ty pewriter- like 



CTSS PROGBAMMER'S SUIDE Saction AA.2 12/69 2 

device ("console") . Ke issues basic instructions, called 
"-omoiands", to the system by typing the name of the comiand 
and the arguments associated with it; the systeia will then 
bring in the program which is associated with (i.e., "which 
performs") the ccminand and cause it to be executed. In 

ganaral, the user types in lower case and the system's 
responses are in upper case (except on teletype devices, 
whi-h operate only in upper case). When the system receives 
i command it acknawledges receipt by typing out on the 
user's console a line comptisiiiy tue xeui-ei. " v^-^*- "ax^; 
followed by a five-digit number expressing the time of day. 
When the ccBuand has finished working, the system informs 
th2 user of this fact by typing a line comprising the letter 
"bL" (for Ready) followed by two numbers separated by a plus 
sign, the first number expressing the number of seconds 
expended in executing the command and the second number 
expressing the number of seconds expended "swapping" the 
program (s) involved in and out of core. 

Ttia user is said to be at "command level" after 
receiving an "8" (Ready) line. When at command level, he may 
issue any system CDmmand desired. During the execution of a 
program, however, commands are not accepted; in particular, 
as commands themselves are programs they can not be 
over-ridden by the typing of new commands. In order to 

return to command level before the executing program has 
finished, then, the user must give a "quit signal" to the 
system. This quit signal is two pushes of the console's 
"braak" button. The ability to quit is quite useful, 
especially when, for example, a user's program misbehaves or 
a command has furnished enough information for one's 
purposes but would continue to operate "longer" if not 
interrupted. 

F iles : 

Most often, the arguments of commands are the names of 
"filas" where a file is broadly defined as a logical set of 
information. A file may contain ("the information may 
represent") a source program, an object program, a set of 
data, text, lists, or almost anything definable by the user 
which is axpressable in the symbols available. These files 
may be input from CTSS consoles or from punched cards (see 
Section AE.1) and are normally stored on the computer's 
magnetic disk storage devices; however, their actual 
location is of no importance to the programmer since he 
always refers to files by name. The system itself provides 
for references to actual locations internally and maintains 
a saparate "file directory" for each user so that no 
conflicts arise in the assigning of names. 

A master file directory (B.F.D.) is maintained, 
containing information about the location and contents of 
the several user file directories (U.F.D.) . Each U.F.D. 



:;ontains inforaation about the location and contents of the 
various files which the user has created. The U.F.D. is 

associated with a problen number and a programmer number. 
Also associated with certain problem numbers are "common 
files" — file directories which contain files of common 
iutarast and are directly accessible to all users on the 

Certain of the common files associated with the system 
programmers* problem number (Him6) contain information of 
jsnaral utility and ace accessible to all users. (See 

Section AD for further information about files.) 

Each file is required to have two names, a "primary" 
name and a "secondary* name, each of which consists of six 
or fewer characters. The primary name is almost always 
arbitrary and should have some mnemonic importance. The 

sacondary name may 3r may not be arbitrary, depending on the 
contents of the file and the way in which they are to be 
usaJ. For example, a file containing a WAD (Michigan 
Algorithm Decoder) source program may have the arbitrary 
primary name PROGl, bat must have the secondary (class) name 
"MAD". Cbject program files have the secondary name "BSS" 
(Binary SyiFbclic Subroutine) . 

Learning to use ZTSS is similar to learning to play the 
guitar. Knowledge of a few basic chords enables the novice 
musician to play a rather large number of songs; knowledge 
of a few basic commands enables the novice CTSS user to 
write and execute an arbitrarily large number of programs in 
a rather large number of programming languages (Section 
AH. 2). Beyond this basic area of application (which is the 
only one dealt with in detail here), however, are at least 
two other large areas of special application. In the first 
place, there exists a large number of special -purpose 
commands for such purposes as file manipulation, debugging, 
documentation, and interactive problem-solving (Section AH) . 
In the second place, user programs may avail themselves of a 
wealth of library subroutines, both batch-processing and 
tima-sharing in nature (Section AG). By taking advantage of 
these additional tools, the CTSS user may expand his 
rapartoire of applications as necessary, and probably more 
rapidly than the guitar player expands his repertoire of 
songs. 

Further general inforaation of interest may be found in 
Sections AA.C and AA.1. Inforaation about the use of the 
manual may be found in Section AB- 



CTSS PttOGR&MMER'S 3UIDE Sa=tion AA.2 12/69 U 

OVESVIM OF EiSIC CONSOLJ TECMIflOJS USED IM EHOGBAM 
CREATION 

1. Typing ercocs in command lines and in input lines 
may be corrected by typing a commercial at sign 
(8) to cause the system to ignore ("kill") the 
entire line thus far, or by typing one or more 
sharp signs (#) to cause the system to ignore 

("erase") one or more immediately preceding 
characters. 

2. A console session is begun (after turning on and 
dialing in the console) by issuing the LOGIN 
coBBand, identifying the user to the system and 
establishing that a line to the computer is 
available. 

3. Source programs will be entered and modified or 
corrected using the text editing command EDL. 

(Other available editing commands are covered in 
Section AH. 3.) 

U. Coupilation will be accomplished by the HIE 

command in this document — although other 
compilers and assemblers are available in CTSS 
(Section AH. 2. ) 

5. Once a program has been successfully compiled (or 
assembled), execution is effected by the LOACGO 
command-again for purposes of this documentation; 
loading of programs is covered generally in 
Section AH .7.01 . 

6. When a program has been satisfactorily run, it aay 
be removed from the user's file directory by use 
of the DELETE command. Files not explicitly 
deleted will be left alone and will still reside 
in the disc storage units. 

7. At the end of a console session, the LOGOUT 
command is given to inform the system that the 
user's line to the computer is free to accomodate 
someone else . 

DESCRIPTIOH AND DIS3 USSION OF CCKjlAMDS 
The LOGIK Coffmand: 

After the coasole has been turned on and dialed in, 
type a line of the following general form: 

"login probno name". 



t;T:>s tHCtiKAnntsS'5 GUIDE 3e«-ti»jn An.2 .*./u^ 

whare probno is an argument of the LOGIN comniand specifying 
the user's assigned problem number, and the second argument 
is the user's last name. Commands ^nd arguments must be 
separated b^ at least one blani~~("sBace"). The system will 
respond ~ with a slait) line, and then will type out 
"PASSHOBD". At this point, the user must type his assigned 

i_ Xv cl 4- c L;a.ooliwi.»-i^ vA\ii.j-**y WAft.^x«&«. b-^iuc? *-** c -^ ^^^ is^*- -.■»- — ^ jpr^.»„^»„^ 

will ba suppressed. Provided a line is available — and the 
user has been allotted time and disk storage records on the 
system — a message acknowledging the fact that the user has 
been "logged in« will follow. (Further details may be found 
in Section AH. 1-01). 

When there is no line available, the system will cause 
the console to be "hung up" (disconnect at the systen's end 
of the connection) , and the user should try to log in at a 
la tar time. If , on the other hand, no response is typed 
after the login command was given, CTSS is not in operation; 
information about when it is expected to be back in 
operation may be gotten from data-phone ext. 1300 (recorded 
massage) , or if the recorded message has not yet been 
updated, from the computer operator at HIT ext. U127. 
Occasionally the system will not recognize "login" as a 
command; this means that the name of the login command has 
been temporarily altered so that the system programming 
staff can hold a test session. 

The EDL Command for In^ut: 

1. EDL is a CTSS command which is used for input and 
for "context editing" of files. He will take 
advantage of its input facility, to create the 
files which will later be edited. "Context 
editing" requires the unique specification and 
location of a line in terms of its contents by 
means of appropriate requests ("subcommands" of 
EDL) before the line can be edited. (This rather 
obscurely-stated point should be made clear by 
discussion below — EDL for Editing, point 5 — 
and by the Appendix) . Bequests to EDL may be 
abbreviated by their first letter, with the 
exception cf the request "file" (see point 8), 
although the full request name may also be used; 
the abbreviated forms will be used herein. 

2. A more complete description of the EDL command 
may be found in Sections AH. 3. 07 and AH. 9. 01. 

3. To begin input: type, e.g., "edl abc123 madCR" 
or, in general, "edl name 1 name2CB", where CR 
indicates Carriage Return. 

^. Response: FILE ABC123 MAD NOT FCUBD. 



CTSS PROGRAMMER'S SOIDE Section AA.2 12/69 6 



I nput 

"Input" is one mode of the EDL coBmand ; "Edit", 
the conaand's other mode, is discussed below. 

5. For all lines which do not begin with statement 
labels, strike the "Tab" key, then type the line. 
For lines with labels: type the label, then 
strike Tab and type the rest of the line. For MAD 
continuation card indicators: tab, backspace, 
indicatDr, line. When finished with a line, 
strike Carriage Return (CB) . 

N.B. Wherever Cfi is indicated, strike the 

appropriate key on the console; do not type the 
letters "CH". 

6. To deal with typing errors while still 

working on the line in which they occur: The 

sharp sign (#) serves as an erase character and 
causes the ignoring of the immediately preceding 
character; aore than one erase character may be 
used (e.g., XXIiflZ will be treatad as XYZ by the 
computer). To kill the entire current input line, 
strike the at-sign (3). 8.B. This also deletes 
tabs, e.g., "/tab/x=a*biy/tab/x=a1*b" causes 
»y/tab/x=a1*b" to be treated as the input line. A 
kill character cannot be erased. 

7. For typing errors discovered in prior input lines: 
fellow the procedures discussed below under the 
EDL command for editing (beginning with point 4). 

8. To file a program: strike an extra CB (i.e., CR 
after last line plus CR for an "empty" line); this 
action causes entry to the Edit mode in which the 
request "file" may be used. Response will be a 
system R (eady) line, and the user will be at 
"command level" again — which he was not while 
using EDL. (It is important to distinguish 
between general system commands, on the one hand, 
and requests to a specific command, on the other.) 
A file named, e.g., "abc123 mad" will have been 
established in the user's file directory. 

». B. EDL »ILL ACCEPT REQUESTS IH THE EDIT MODE 
ONLY; in the Input mode, all material typed is 
treated as input . 

9. To verify input (optional): type (general form) 

■• 2—1. —^-4 .^^»-^n mu« nn Tu 1i ^ ^ m m r% r^ A it -ill ^^^ t\ c?£^ 

•■ ui. All L ua Uiei ilduic^". ^iic c a j-H jl v-uw ut<i »i<a m ^ j. j. ^\t, \a^-^ 

the file to be typed back on the console. 



CTSS f HUUaAnnKK 'a i»UIDE 3Bi-;tiuii AA . 2 '12/59 



Th3 WAD Command foe C2.mje,ilation: 

1. To cause the MAD (or the appropriate language's) 
compiler to operate on a program: the command is 
the name of the language and the argument is the 
_^i_-,^™ ,^^ ma r^f 4-Ka f^ia- ^ a^. "mad abc12^"- 
The secondary name of the source file aust be 
"MAD" , 

2. Response from successful attempt: A line 
beginning "LENGTH," followed by various other 
information. A file named , e.g., "abc123 bss" 
will have been created. 

3. Error messages: These indicate "syntactic" 
mistakes; the source program file must be 
appropriately corrected. 

a. Further details may be found in Section AH. 2. 10. 

The BDL Command for Editing: 
(CR Indicates Strike Carriage Return) 



The following is excerpted from Section AH. 9. 



01 



Editing is done line by line. We may envision a pointer 
which at the beginning of editing is above the first line of 
the file. This pointer is moved down to different lines by 
some reguests, while other reguests specify some action to 
b3 done to the line next to the pointer. All reguests 

except FILE may be abbreviated by giving only the first 
latter. Illegal or misspelled reguests will be commented 
upon and ignored. 

The Appendix and the discussion below should clarify the 
importance of the "pointer". Reguests which take arguments 
must ba separated from the arguments by a space. 

1. Type "edl namel name2CR" (general form) . 

2. Response should be "Edit". 

3. The EDL command will type back lines ("verify" 
them) after certain reguests. The requests which 
will cause verification are "locate" and "change" 
(discussed below) ; wait for the response before 
issuing another request when one of these two has 
been given. 

4. Type "tCR" (" t" is the abbreviation for "top"). 
(This is not strictly necessary for beginning to 
edit, but is reguired when the Edit mode has been 
entered from the Input mode, or when the pointer 



CTSS PaOGRAMMER'S 3UIDE Section AA. 2 12/69 8 

icust be noved "upwards".) The "pointer" is 

positioned "above" the first line of the file. 
Note that "top" is the onlj request to EDL which 
moves the pointer "upwards". 

5. To position the pointer to a particular lire, use 
"1" (for "locate"). The argusent of this request 
(typed after a space which aust follow the "1") is 
a string of characters which uniquely specifies a 
line amDngst the lines "below" the pointer. The 

pointer will be moved to the line which contains 
the first occurrence of the string. E.g., if the 
"top" request had just been issued and the first 
two lines of a file were 

A = B+C 
D = A+X 

the request "1 aCR" would position the pointer at 
the first line, but "1 a+CR" would have positioned 
it at the second line. (Mote also that in the 
latter case the first line is then «above" the 
pointer, and if it is to be operated upon, the "t" 
request - "1" request sequence must be given 
again. ) 

6. To replace an entire line, the request is " r" 
(for "retype"). The argument (typed after a space 
which must follow the "r") is the entire new line 
itself (with appropriate tabs and terminal CB, as 
in Input), This request does not move the 
pointer. 

7. lo change a portion of a line, the request is "c" 
(for "change") , The argument (space as usual) is 
rather complex: Begin with an arbitrary character 
which does not appear in either the original 
string of characters to be changed or the new 
string ("q" is frequently useful); this character 
serves as a delimiter of the two strings. Between 
the delimiters, type the old and the new character 
strings, in that order. The first occurrence of 
the old string will be altered. For 
example, »c gabcqxyzqCB" will cause "abc" to be 
replaced by "xyz", and if the original line were 
"abcabc" the resulting line would be "xyzabc". 
Blanks within the strings are significant: "a be" 
is^not the'same as "abc". (This request does not 
move the pointer.) "Global" changes are possible, 
but will net be dealt with here. 

8. To insert one line after the line currently 

pointed at, type "i", followed by a space, 
followed by the line to be inserted. To insert 



CTSS PFCGRAMMER»S GUIDE Section AA.2 12/69 9 

several lines, change node from Edit to Input by 
giving an "extra" CR, or by typing "iCR". The 

response will be "Input". Type the line or lines, 
with appropriate tabs. When done inserting, 

return to Edit mode by giving an extra CH. 

9. To delete a line or lines; position the pointer 
(with the "1" request) to the first line to be 
deleted, then type "d" (for "delete") followed by 
CB if only this one line is to te deleted, or by a 
space and a number (expressing the nuabec of 
consecutive lines to be deleted) if more than one, 
then" 3rT~ (This request leaves the pointer 
positioned at the last line deleted.) 

10. To Bove the pointer "downward" one or more lines, 
the request is "n" (for "next") ; it takes a 
numerical acgunent , in the same fashion as "d". 

11. To re-file under the original file name, simply 
type "fileCR" (from the Edit mode). This process 
replaces the older" version with the edited 
version. 

12. To file under a new file name, type "file xxxxxxCR" 

where xxxxxx represents the new primary name. 
This process preserves the older version, in the 
event that a comparison of both versions is 
desired for some reason (e.g., to determine which 
of two methods takes longer) . Secondary names may 
not be changed when filing. 

The lOADGO Command for Jxecution: 

1. After a successful compilation or assembly (no 
syntactical errors) has been achieved, the command 
"loadgo namel" will cause the object program 

("namel bss") to be loaded and executed. Library 
search occurs during the loading process. 

2. Shortly after the customary W(ait) response, 
the word "EXECUIIOM" will be typed by the system. 
This will be followed by the program's results, if 
all has gone well with the program. Then, 
provided there were no execution errors, an 
end-of-run message and a system R (eady) line will 
be typed out. 

3. Further details may be found in Section AH. 7. 01. 
Program Logic "Debaqqing^: 

1. Hrcng results imply errors in program logic. (See 



CTSS EBCGBAMMEB'S GUIEE 



Section AA . 2 12/69 10 



CC M3IBO 182 foe a list of comaion prcgramaiing 
errors. ) 

2. When discovered, the errors can be corrected in 
the source file (namel mad, e.g.,) "ith the EDL 
comnaDd . 

3. After editing, the program must be recompiled 
with the appropriate language command (WAD). 

4. The new program is executed with the LOADGO 
covmand. 

5. If the results are still wrong, back to 1.... 

When a program is no longer desired, all files relating 
to it can be removed from the disk b| typing (general form) 
"delete namel *ca". The asterisk indicates to the DELETE 
command that it is to operate on all files with primary name 
"namel". Cf course, individual files may be dealt with by 
"delete namel name2». (Further details may be found m 
Saction AH. 6. 03). 

Th3 LOGODT Command ; 

At the end of a console session, give the command "logout". 
Th^ system will respond with the present time, the date, and 
the total time used (in minutes). (Further details may be 
found in Section AH. 1.02.) 



CTSS PROGRAMMER'S SOIDE Section AA.2 12/69 11 



APPESDIX: CONSOLE FAMILIAfil ZA TIOS SESSICK -- AM AHJOTATEC 
SCRIP 3" 

The program created in this script is deliberately 
simple-minded, sc as not to distract from the basic point at 
issue — console usage. (For demonstration purposes, some 
of the errors introduced are unique to the MAD language, but 
should be reasonably clear to the reader even if he is not 
familiar with MAD). The program is intended merely to 
compute and output the square root of the sum, and the 
product, of t«o numbers input from the console. (Data can, 
of course, be input to the program from files as well as 
from the console. Indeed, batch processing tape techniques 
are simulated on CISS -see Section AG. 5 — and numerous 
subroutines are provided for direct disk file I/O — see 
Section AG. 2.) 

I.DSt£ii£ii2iJ§ • 

1. Type the lines appearing in lower-case letters and 
wait for the system responses if a line in 
upper-case Dccurs next in the "script". 

2. Hit Carriage Return at the end of each lower-case 
line. 

3. Circled numbers to the left of the page refer to 
the Notes, which follow the "script". 

4. Long-hand insertions are typing instructions 

(usually involving the Tab key) e.g.. Tab 

5. The numbers in i (ait) and R (eady) lines are 
fictitious; expect different ones. 

6. Before issuing the DELETE command, the LISTF 
command may be used to get a listing of the 
contents of your file directory (Section AH. 5. 01) , 
and TIPEEK may be used to get a table of ycur time 
and track usage for the current month (Section 
AH. 1.04) . Neither command requires arguments. 

ScrrJEt: 

login raiai6 padlipsky 

W 1315.1 

Password 
STANDBY LINE HAS BEEN ASSIGNED 

M1416 3711 LOGGED IN 10/22/69 1315.6 PBCH 800289 
LAST LOGOUT WAS 10/19/69 2247.1 FROM 800315 



(i>~ 



& 



CTSS PROGRAMMER'S 3UIDE Section AA.2 12/69 12 



CTSS BEING USED IS MIT8A3 
R 6. 783+. 000 

edl simple mad 
V 1316.4 

FILE SIMPLE MAD HOT FOUND. 
Input 

normal mode is integer 
floating point a 

-T3,io print comment$numbers, pleeuh2##f f aseS 

Tsfc read data 

'^''^ a=sqrt (b+c) 

j -^ d=bc 
ana ofa "T^h end of program 



Edit 

t 

^—^ 1 mode 

13 L B^M*!* ^°^^ ^S INTEGER 
\Z^ ^r ■^»'» normal mode is integer 

(n) r -Tab floating point a, d 

^>-— ^ la 

/■^V"'^ FBIMT COMMIMrSSUBBERS, PLEASES 




c qtqt, q 

1 a= 



A=SQBI (B+C) 

A = SQBT.{B+C) 
D=BC 



0- 



1 

Input 

'ab print results a, d 
'^ab execute exit. 



0~ 



Edit 
file 

R 5.833+4.250 

print simple mad 
H 1321.3 



SIMPLE MAD 01/10 1321.4 

BOBMAL MODE IS INTEGER 

FLOATING POINT A ,D 

PRINT COMMENTSNUMBERS, PLEASES 

HEAD DATA 

A=SCBT. (B + C) 

D=BC 



CTSS FRCGBAMMER»5 GUIDE Section AA.2 12/69 13 



PRINT RESULTS A ,D 
EXECUTE EXIT. 
EMD OF PROGRAM 
R .616+1416 

mai simple 
W 1321.9 
THE FCILOWING BAME5 HAVE OCCURRED ONLY OMCE IN THIS PROGRAM, 
THEY WILL ALL BE ASSIGNED TO THE SAHE LOCATION, AND 
COMPILATION WILL CONTINUE. 
BC 
B 
C 
LENGTH CC072. IV SIZE C0006. ENTRY 00016 
R 2. 766+. 533 

edl simple mad 

W 1322.8 

Edit 

1 b = 
/^~N D=BC 

ilO ) c; tjbqb+q 

^^ — D= E* C 

file 

* 

R 3.516+1.450 

mil simple 

W 1323.7 

LENGTH 0C071. IV SIZE 0C006. ENTRY 00015 

R 2.216+.750 

loadgo simple 
W 1324.1 
EXECUTION. 
NUMBERS, PLEASE 
b=7,c=2* 

A = 2.707999E 26, D = 14.000000 
EXIT CALLED. PB MAY BE TAKEN. 
R 6.166+1.050 




// 



edl simple mad 

W 1325.5 

Edit 
^-^ 1 mode 

ff£\ NORMAL MODE IS INTEGER 

1 read 
/''~\__ BEAC DATA 

(/3) i -n^J? whenever (b+c) . 1. 0., transfer to tag 

^-^ 1 3Xit 




/^ 



0- 





CTSS PROGRAMMER'S GUIDE Section AA.2 12/69 14 



EXECUTE EXIT. 
z >jc}tag2g 
TAG2 EXECUTE EXIT. 

Input 

tig 'T^t> print comnent Snegative arguments 
'^^'^ transfer tc tag2 

Eiit 
fil3 

* 

R 2.950 + 3. 150 

mad simple 

W 1523. 1 

LENGTH 00107. TV SIZE 00006. ENTRY 00020 

R 2.966+.9C0 

loadgo simple 
H 1523.7 
EXECOTIOS. 
NUMBERS, PLEASE 
b=7. ,c=2. ♦ 



|l^) A = 3.000000, D = 14.000000 

EXIT CALLED. PM MAY BE TAKEN. 
R 6.566+1.083 

loadgo simple 
W 1524.7 
BXECOTIOU. 
NUMBERS, PLEASE 
b = -7. ,c=,2. * 
NEGATIVE ARGUMENT 

EXIT CALLET. EM MAY BE TAKEN. 
R 6.216+.816 



0- 



ialata simple ♦ 

N 1526.1 

R 1.716+366 

logut 
/^~N W 1528.2 

in) 'LOGUT' NOT FOUND. 

— ^ R .000 + . C83 

flo\ — logout ni1416##### 
V_y W 1528.4 

111416 3711 LOGGED OUT 10/22/69 1536.3 FROM 800289 

TOTAL TIME USED = .7 MIN. 



CTSS PROGBAMMER'S GUIDE Section AA.2 12/69 15 



N o ta s : 



1. He decide pleeuhz isn't funny and use 
four erase characters. 

2. The "empty line" takes us to Edit mode. 

3. The line shauld have been tabbed originally. 

4. Saffle as 3, and we realize ve want both answers 
floating. 

5. These two locates demonstrate "context editing". 

6. He renember that HAD subroutine calls require 
periods. 

7. This insertion allows us to see the answers after 
execution and terninates the program in standard 
fashion. 

a. The "enpty line" again. 

9. Verifying the typing- 

10. The error message reminded us that we meant EC to 
be a product, not a naae. 

11. Whcops.* A is 'way wrong. He have a bug. 

12. He remember that the square root routine expects 
floating point arguments, and take the easiest 
route cf getting them to bs floating — deleting 
the integer mode declaration. 

13. He remember that the square root routine also 
expects positive arguments. 

14. Still another "empty line". 

15. N.B. the decimal points. 

16. Success, 

17. And success again. 

IB. The misspelled command is not f indable. 

19. Erase characters apply in command lines too. 



(END) 



CTSS EBCGBAMMER'3 GUIDE Section AA.2.01 12/69 1 

115. Unification 

Fixad File Names 

Intcojuction 

Unexpected file names appear in a user's file directory fcom 
time to time. The following is a partial annotated list of 
filas generated: 

1) by CTSS in performing system duties; 

2) by one of the commands which makes a new file 
as part of its execution process; or 

3) by another CTSS user. 

Bote, and be warned, that catastrophic conflicts will arise 
if sevaral users are performing a command which generates a 
fixed file name at the same time in the same file directory 
(usually a common file). The obvious way to avoid such 
conflicts is to avoid performing such commands while 
attached to any directory other than one's «homa directory". 

Files With_Bcth_Names_Fijed 



C. 0. D. 


B.0.». 


AH. 2. 10: 


M.T.X. 


0. V.F. 


AH. 2. 10: 



These files are used for intermediate data by the MAD 
command . 

(COHBI HFILE) AH. 6. 01: 

This name is given to the intermediate file employed by the 
COMBIN command. It may be deleted if found. 

MAIL BOX AH. 9. 05: 

This file is created (or appended to) when a user gives the 
command MAIL with the problem number and program number of 
tha addressee's file directory. Hben the recipient 

subsequently logs in the following message will appear 

his console : 

YOO HAVE NAIL BCX 



(MOVIE TABLE) AH. 7.01, AJ.B.01: 

Tha MOVIE TABLE is created by the standard loaders. It is a 
temporary mode file and represents a map of the programs 
loaded. 

OOIPUT RQOEST AH. 6. 06: 



on 



CTSS PROGRAMMER'S 3 UIDE Section AA-2.01 12/69 2 



The BQUEST conmand fee bulk I/O creates or appends to a file 
in the user's disk storage. When the file has been 

processed by the disk editor, it is set to temporary iBode. 

PEBHIT FILE AH. 3. 05: 

The PERMIT coBinand establishes a line-marked file of private 
protected mode in the user's directory; PESHIT FILE contains 
information used in the linking process, 

UB3ENT HAIL AH. 1.0 1, 

UBGENT POST AH. 1.01: 

DAEMON can create this file in a user's directory so that 

his subsequent LOGIS will remind him TO PBIMT the new file 

in order to get a message from the system. The alert 
message printed en his console is: 

YOO HAVE OfiGEHT BAIL 

or 
lOU HAVE OBGENT POST 



OSEB PROfIL AH. 2. 19: 

This file is used by the '.* command to store the 
abbreviations and lists cf SAVED files. 

(BUG) SAVED AH. 8. 08: 

This file is used by DEBU3 to iKive the current core image 
whan executing CTSS commands from within the program. 



Eiies_Mith_Fixed_Seccnd_ Barnes 

HAME1 ASCII AH. 3. 09, AH. 3. 10: 

EDA or QED (with the 'wa' instruction) creates a file with 
secondary name 'ASCII'. The BOFF command expects a file 
with the secondary name 'ASCII'. 

NAME1 BCD AH. 2. 07, AH. 2. 10, 

AH. 2. 11: 

A file of secondary name 'BCD' is produced by several of the 
language processors on reguest. Su::h files contain 

ass3 mbly/com pilation listings; they are generated in 
tesponsie to the arguueiit ' (LIST) ' in the Idiigua^e pLoueSaoL 
command. 



CTSS PBOGBAMMER'S SUIDE Section AA.2.01 12/69 3 



HAHE1 BSS e.g., AH. 2. 07, AH. 2. 10, 

AH. 2. 11: 

A «BSS' file contains an object program, produced by one of 
the language processors. 'BSS' is a 7094 term, docunented 
alsa Hhare. 

NAWEI (DUHP) AJ.8.03: 

For details, see the DOflPEB SAVED write-up, 

SAMEI (MEMO) AH. 9. 01, AJ.6,01: 

TYPSET creates a file with the secondary name • (MEMO) •. 
RUNOFF expects a file with the secondary name •(MEMO)*. 

NAME1 RUNCOM AH. 10.01: 

A file of secondary na ne •FUNCOM* or 'BCD' may be used to 
lafins a procedure consisting of a number of CTSS commands. 
These files may be executed at the console with the BUNCOH 
command or under FIB. 

MAME1 BUMOFF AH. 9. 01, AH. 9. 06: 

This file is created when using the 'PBINT' option with 
sither the BU80FF or BOFF commands. It contains the 
formatted version of the (MEMO) or ASCII file as it would 
normally appear on the console but it suitable form for 
offline printing via the HQASCI command. 

SAME1 SAVED AH, 3.03: 

•SAVED* files contain machine conditions and core-images, 

P„.~ r-i-iKornnii/sn 4- c%-v ar'n ^ i r\n Vnr flofailiS. «?«»*> th© SAVE 

write-up. 

progno SAVED AH. 3. 09, AH. 10.03: 

(Whara prognc is the user's programmer number.) This file 
is created by serveral commands (including SAVE and CED) and 
contains the user*s machine conditions and core- image for 
later BESUMEing or COMTINeing. 

progL SAVED AH. 1.02: 

(The user's prograsuier number followed by the letter "L".) 
At any time an automatic LOGOUT may be initiated by the 
system. The file may be RESUMEd at a later time. 



CTSS EfiCGRABrtEB'3 GUIDE Section AA.2.01 12/69 



NAHE1 SQZESS AH. 4. 04: 

•SQZBSS' files contain compressed- form BSS "decks". For 

details, see the write-up on PADBSS SAVED and SQZBSS SAVED. 

NAMEl SYMTAB AH. 2. 10, AH. 2. 11: 

This is an cpticnal file containing a synitol table, produced 
by the MAD (and, of course, MADTRS) language processor in 
rasponse to the » (SYMB) • argument. 

HAHE1 SYHTB AH. 2. 07: 

This is an automatically-generated file containing a symbol 
table, produced by the PAP language processor. 

FyL.3s_With_S£ecial_or_Fixed_First_ Names 

FAPBCD progno 

FAPBSS progno 

FAPSYH progno 

FAPTEH progno AH. 2. 07: 

(whsra "progno" is the user's programmer number) These files 
areused by the FAP command in the assembling of the user's 
program . 

(INPUT progno AH. 9. 01, 

(IHPrI progno AH. 9.01: 

These two names are used for intermediate files by lYPSET, 
ED, and EDL . Following a quit sequence (or an automatic 
LOGOUT) either one of these files may be found. It may be 
renamed and used as a source file (in the automatic LOGOUT 
3as3, editing may, of course, be continued when the prognoL 
SAVED file is resumed). When invoked, the editing commands 
will announce the presence of one of the intermediate files 
(if one is present); the user must either type 'yes* to the 
guestion'about deleting it, or type 'no' and then HENAME it. 
Tha commands will not proceed unless the intermediate file 
is disposed of, one way or another. 

probnc progno AH.U.01: 

This is an intermediate file used fcy the ARCHIV command 
(irfhere probnc, progno are a user's problem number and 
programmer number). For details, see the ARCHIV write-up. 

.TAPE. 3 AG. 5.01: 



Taa .PUNCH, . PNCHL and (SCH) subroutines create ot a^penu 
a pseudo-tape line-marked file named ,TAEE. 3. 



_ -3 ^ — 



CTSS PFCGRAHMER'S GU ICE Sectxon AA./.UI IZ/O^ 



.TAPE. D AG. 5.01: 

Tha .TAPHB, (STH) and (STHM) subroutines create or append to 
a pseudo-tape line- narked file named .TAEE, n, where n is 
specified in the calling program. 

...XXX D AV CU HO.O.U^: 

This is an intermediate file used in chaining comnands. For 
details, see the SCHAIN urite-up. 

...OOn SAVED AH. 3. 04: 

This is an interniediate file used in chaining connands. For 
datails, see the BDNCOH write-up. 



(END) 



CTSS PROGRAMMEB'S GUIDE Section AB.1 12/6y 1 

Identification 

Conventions of this manual 

This CTSS Programmer's Guide will be divided into sections 
on a functional basis. The naming of the sections will be of 
tha foriaat HS.X.YY. 

M is the manual designation. Since the CTSS 
Programmer's Guide for the IBM 7094 is the 
first manual in a series, its designation will 
be "A". 

S is an alphabetic major section designation, 
e.g., this is section "B". 

X is the one or two digit subsection 

designation. This first publication will have 
subsections numbered from 1 to 13. Note that 
they will not be designated as 01 to 13. 

YY is the minor subsection designation. This is a 
two digit numeric designation (00,01,02....) 

The manual was prepared by the CTSS commands QED and ROfF 
whare aach section is a separate file of the name MSXYY 
ASCII. Hote the deletion of periods within the file name. 

Users may request copies of complete manuals or any section 
thereof from the Information Processing Center's 

publications office. Or, at the user's convenience copies 
may be ROFFed on the user's 1050 or 27U1 Selectric console 
or Modal 37 Teletype. All of the files are linkable through 
file directory Mim6 32 12. 

The table of contents will be maintained in two forms. 

1) TABLE ASCII which may be BOFFad to produce the 
current table of contents in the form 
distributed with the manual (i.e., in 
sectional or functional order). The first line 
of TABLE will fce dated to indicate the date of 
the latest change to the manual. Any revisions 
of the manual will be noted by date beside the 
section which was modified. 

2) DATIOC ASCII which may be ROFFed to produce a 
table of contents in reverse chronological 
order of section modification. This will show 
rapidly the latest changes to the manual by 
secti3n and date. 

Within the text of the manual, areas of 
modifications will be noted by an asterisk or 



CTSS ESCGRAKMER'3 GUIDE Section AB,1 12/69 2 



bar in the right hand margin. This will be 
done only on one level of revision, that is, 
the flags of any earlier revision will be 
reBoved before the later modifications are 
made . 



Because the nanual will be done as nuch as possible with the 

current limited character set and as little hand work as 

r^^ooihio hw i-Vit> twri.ct. the following conventions will 
usai. 



be 



1) The symbols designating "less than", "greater 
than", "less than or equal to", and "greater 
than or equal to", will be replaced by the MAD 
conventicns of .L., .G., .LE., and .GE. 

2) Octal notation is expressed as the octal 
number enclosed in parentheses, followed by an 
8, e.g. (7777)8. 

3) Exponentiation is expressed in the MAD 
notation of .P. (e.g., 2. P. 9). 

«4) Optional arguaents in calling sequences to 
subroutines will be enclosed within minus 
signs (e.g., -P&E BUFF-), This applies also to 
arguments to commands (e.g., -NAME2-) . 

5) Indication for a literal within a subroutine 
calling sequence will be typed in lower case 
and be enclosed within single quotation marks 

(e.g. 'j'). This means that the actual value 
should be used, rather than the location of 
the value. 

6) Some command arguments must be literal values 
and these will be shown as uppercase 
characters enclosed in single quotation marks 
(e.g., •REV»). This means that no 
substitution is possible, but the actual 
characters shown must be used. 



(END) 



CTSS EEOGRAMMER'5 GUIDE Section &B,2 12/69 1 

Glossary and Conventions 

Hi thin calling seguences, arguments written in upper case 
denote the location of a variable. Arguments in lower case 
denote the value itself. If literals are used, they are 
notad as such by the conventions of the language or as lower 
case letters enclosed in single quotation marks. Minus signs 
around an argument mean that argument is optional. 

Thare are three possible kinds of calling sequences for 
subroutines. The stateaent "as supervisor entry:" means that 
tha usar must supply the TIA as noted beside the TSX. The 
statement "as supervisor or library entry:" means that the 
usar may supply the TIA as noted, or he may use the external 
library name noted in the rsx in which case the library will 
supply the TIA. The statement "as library subroutine:" means 
that tha subroutine is an external library routine. A HAD or 
Fortran calling sequence will usually be given but the 
routine may also be called by the equivalent FAP calling 
sequence. 

Glossary 

* in front of an entry in the table of contents, 
indicates the new I/O system. An ♦ in the 
right-hand margin, indicates a modification to 
the write-up. 

AC 3 6- bit signed accumulator. 

b denotes a required blank in a character 
string • 

C. B. carriage return. 

Console In general, the word console means a 

typewriter console (e.g., 1050, 2711, 

teletype) rather than a special display 
console (e.g., ESL scope). 

Current Pile Directory is the file directory to which 
the user is currently switched. It is usually 
the usee's file directory but may be switched 
to a comaon file directory by COBFIL or to 
another user's file directory by ATTACH. 

External Boutines are subprograms (with entry points) 
which are called by other subprograms. The 
library entries and library subroutines are 
external routines. The FAP calling sequences 



CTSS £RCGBAMM£H'3 GUIDE Section AB.2 12/69 



give the entry point name. The FAP convention 
for calling external routines is: 1) EXTERN 
pseudo-oc specification, or 2) preceding the 
name by $, or 3) CALL pseudo-op. All the FAP 
calling sequences in this documentation assume 
EXTERN specification so that the CALL and $ 
are not shown. 

Fence is a magic number used to designate the end of 
a variable-length string of parameters. The 
fence referred to in this documentation is a 
word of all octal sevens. 

FILNAM is used in calling sequences to indicate the 
initial location of 2 BCD words containing the 
name of a disk file (right justified and 
blank padded). In Fortran programs, FILNAH may 
be set by the subroutine SETHAM or it may be 
the file name in H specification form. In BAD 
programs FILNAH may be set in a Vector Values 
statement . 

FMT or FORMAT is used in calling sequences to 
indicate the beginning location of a format or 
a location containing a pointer to the 
beginning of the format, if SETFST is used. 

Library Entry - The majority of the required TIA's for the 
supervisor entries have been placed in the 
library as library entries. 

Lina-Marked Files ace files composed of variable length 
records. Each logical record is preceded by a 
word containing binary ones in bit positions 
0-17 and the number of words to fellow in bits 
18-35. 

Line-Numbered Files are files composed of 1U word logical 
records. Characters 73-80 are a sequence field 
(the leftmost 3-6 may be alphabetic and the 
rightmost 2-5 must be numeric). 

LIST is used in calling sequences to provide a list 
of parameters to the subroutine being called. 
It usually specifies parameters for input or 
output. A list may consist of a combination of 
single variables, dimensioned or subscripted 
variables, or block notation as described in 
the BAD manuals. In Fortran, the implied DO 
may be used only in I/O statements, not in 
calls to subroutines. 

In MAD, a LIST might be: A, B (1) . . .B (10) , 
C(N)...Z{1), G (J) . The notation E(N).,.N, 



CTSS FBCGBAMHEB'3 GUIDE Section Ab.2 12/6:» 



E{1)...10, is also available; this fora in 
general is acceptable only to I/O system 
entries or associated library routines. 

In FAP, a P2E prefix may fce used with the 
location of a single variable. 

The FAP equivalent of the above WAD LIST is: 

rXH A 

TIX B-1,,B-10 

TIX C-«n',/C-1 

rXH G-»j» 

TIX D-»n*,,ll 

riX E-1,,L(10) i.e., location of a 10 

Memory bound or allotment is the number of core 
registers available to the program, counting 
register 0. Therefore, the first unavailable 
register is equal to the memory allotment, 
except in the special case of (77777)8 when 
the entire 32,768 words of memory are meant. 

BODE With the previous file system, files could be 
one of four modes: 

0. lEMPOfiAHI - words are deleted as they 
are being read or skipped over, 

1. PBHHANEMT - can be read or altered 
indefinitely. 

2. 8EAD-0HLY (class 1) - can be read but 
not altered until the mode is changed. 

3. BEAD-08LY (class 2) - can be read but 
not altered except by a control card 
sobmitted to the dispatcher. 

With the current file system there are seven 
possible modes and the mode of a single file 
can be any combination of the seven, some of 
which are not meaningful. 



COO. 


PER HA ME MX 


001. 


lEHPOHAHI 


C02. 


SECOMDABI 


004- 


BIAD-OMLI 


010. 


WRirE-ONLT 


020. 


PHI ¥A TE 


100. 


PBOrECTED 



NAHEl HABE2 are used in calling sequences to 
indicate the actual name of a disk file. 
8AHE2 is the secondary (class) name. The 



CTSS PBOGRAMMEH'S StlDE Section AB.2 12/69 U 

actual names are right adjusted, blank 
padded, ECD words. 

String Files - files having no logical record 
breaks. Processed as strings of words by 
externally specified word ::ounts. 

Supervisor Entry - supervisor routines which reside in 
A care can be entered only by a special 
calling sequence convention. 

ISX R0U1I8,4 
ABGS 



ROUTIH TIA =HRO0TI» 

If the name of the routine contains fewer than 
six characters, the BCD word referred to in 
the riA aust be left adjusted and blank 
padded. The lIA*s for many of the entries have 
been placed in the library as library entries 
in order to save the user the inconvenience of 
supplying the TIA, and to allow for tracing 
supervisor entries if the standard debugging 
aids are used. 



(END) 



t-TSS ttftJtiHABrtBH'b UUllJJS SectlOn AtJ.J 3/bb I 

liS-H^tif icati cn 

System Documentation 

"Documantation ", in the sense of assembly/compilation 
listings, of CTSS* supervisor, commands, and library 
suuroutinss can uG maue avax^auxe to users xntsresteu in the 
fine details of system implementation. From the on-line 

source language files maintained by the system programmers, 
document tapes foe off-line printing are prepared 
periodically. Although system listings are internal 

documentation of work by the system*s group, there is a 
desire to make the system as widely understood as possible. 
For this reason, system listings are normally made 

available to those who indicate their interest. Users 

dasiring to study large areas of the system (e.g., "the 
library") may request printing of the relevant document 
tapa ; the consultants will explain the details of the 
raquesting procedure. Because these procedures are 

expensive of both machine and system programmers* time, 
casual requests for listings should be avoided. 

Usars desiring to study only a small area of the system 
(e.g., the SQRT subroutine) will probably not want the 
antira contents of document tape; to satisfy this type of 
need, the consultants will have listings of at least the 
library available for browsing. 



(END) 



CTSS FBOtiK Ann Ek ' :> GuIDE Settiuu AC.O 12/69 



n en tif i c ation 

Equipment Configuration 

The primary terminals used with CTSS are modified Model 35 
T3l3 types. Model 37 Teletypes, and IBM 1050 and 2741 

OfcJXe^'-i.iV- I, xz ^ ^ I, J ^^ m i. J. \.^ 1. w ^uuS ^ •-» ».». «^»»~ — — -«— ^ • 

office typewriter) . These terminals are located mostly, but 
not exclusively, within the M.I.T. campus. Several 

demonstrations have been conducted from such places as 
Europa, California, and South America. In addition, CTSS 
supports up to three ABDS storage tube display terminals via 
1200 bit/second phone connections. Access may also be gained 
from the Telex or IMX* telegraph networks. 

Although Teletypes and other typewriter-like terminals are 
aiequate for most purposes, some applications demand a much 
more flexible form of graphical communication. The CTSS 
configuration includes for this purpose a multiple-display 
system developed by the M.I.T. Electronic Systems 

Laboratory for research in computer aided design. The 

system includes two oscilloscope displays with character and 
line generators and light pens, connected to a PDP-7 
3omputar which maintains the display and performs such 
functions as rotation and translation. The PDP-7 
-ommumnicates with the 709U via the direct-data channel. The 
two displays can be operated independent!? of each other. 
Communication with the computer can be achieved by means of 
the light pen, and also through a variety of other devices 
(knobs, swithces, push buttons) , as well as the normal 
typa writer terminal. The meaning of a signal from any of 
these inputs is entirely under program control. Because of 
cible length requirements, the display must be in a room 
adjacent to the 7 094 installation; remote operation would 
require improved data transmission facilities. 

All of these terminals can operate simultaneously by 
time-sharing the 7094 central processor. In order to assure 
reasonably prompt response, the maximum number of users is 
ganarally limited to about 30; however, this number is under 
control of the supervisory program, and is adjusted on the 
bisis of system loading: CTSS has on occasion serviced as 
many as 38 normal users simultaneously. 

The IBM 7094 central processor has been modified to operate 
with two 32,768-w3rd banks of core memory and to provide 
facilities for memory protection and relocation. These 
faatures, together with an interrupt clock and a special 
operating mode (in which input-output operations and certain 
other instructions result in traps), were necessary to 
assure successful operation of independent programs 
coexisting in core memory. One of the memory banks is 
available to the users* programs; the other is reserved for 
the time-sharing system supervisory program. The second bank 



CTSS EBCGBAMMEB'S GUIDE Section AC.O 12/69 2 

was added to avoid imposing severe memory restrictions on 
users because of the large supervisor program and to permit 
US3 of existing utility programs (compilers .etc. ) , many of 
which require all or most of a memory bank. 

The central processor is equipped with six data channels, 
two of which aie used as interfaces to conventional 
pariphsral equipment such as magnetic tapes, printers, card 
readers, and card punches. A third data channel provides 
diract-data connection to terminals that require high- rate 
transfer of data, such as the special display system. 

The fourth data channel provides communication with two disk 
units (IBM 2302) and a low speed drum (IBH 7320). The 
theoretical storage capacity of the disks is 76 million 
computer words and the capacity of the drum is 186,400 
words. The time rejuired to transfer 32K words in or out of 
core is approximately one second for both the disk and the 
drum. 

The fifth data channel provides communication with two high 
speed drums (IBM 7320A). The capacity of a 7320A is the same 
as that of the 7320 but the transmission time for 32K words 
is one-quarter second. 

Tha transmission control unit (IBH 7750) consists of a 
stored- program computer which serves as an interface between 
tha sixth data channel and up to 112 communication terminals 
capable of telegraph- rate operation (up to 200 bits per 
sacond) . An appropriate number of these terminals are 
connected by trunk lines to the M.I.T. private branch 
axchange and to the IHX' and lelex networks. Higher rate 
terminals can be readily substituted for groups of these 
low-rate terminals; for instance, to support ARDS terminals 
at high speed (on output), three 1200 bit/second terminals 
are installed. All of these terminals are compatible with 
Ball System data sets. Part of the core memory of the 
transmission control unit is used as output buffer, because 
tha supervisor program and its necessary buffer space have 
grown in size to the point of occupying all of the A bank of 
Cora memory. 



(EHD) 



Identification 

Clocks 

Pur£Ose 

in i CiOO J. en f u 7 t li ac> dU 111 u CL ya^ i.j.ui^L «,^v^v^jv c.»i*a.j,i^»^j.v- i»»^ 

well as Chronclog clock. The interval tiaer clock is 
complatsly under control of the supervisor; its action is as 
follows: location 5, inemory &, is incremented in the units 
position every ^/bO sec; whenever it overflows, an interrupt 
occurs which, if the clock is enabled, causes a trap to 
location 7 and the instruction location counter to be stored 
in location 6. The interval timer clock is more completely 
iascribed in IBM Manual L22-655U. 

The supervisor uses this clock both for interrupting 
programs and for time accounting. Base- time and 

day-of-tbe- month information are obtained from the Chronolog 
alock which is attached as a pseudo tape unit. The 
supervisor can also simulate the interrupt clock behavior 
for each user. By supervisor calls, the user can program 
for nested interrupts and computation time readings. 



(END) 



u'l'^jb fKuGHannEE'5 SuIDB Seutluu AC. 2. CI 12/63 



I d en tif ication 
CTSS Character Set 

PU££OSe 

on CTSS. The saaller set (the 6-bit or BCD set) is 
basically the 109H standard BCD set of 6-bit character codes 
including 47 characters and blank, and augmented with four 
console control functions. (Carriage return, tabulate, form 
f 33i , and colon, which is used by some programs as a logical 
"backspace" character.) The larger set (the 12-bit or Full 
S3t) consists of 111 graphic and control characters, 
represented as 7-bit codes right-adjusted in a 12-bit field. 
This larger set includes both upper and lower case letters 
and a variety of special characters and console control 
functions. 

Twelve-tc-six bit a^pp|.ng 

All input from consoles is treated initially as 12-bit codes 
by the CTSS supervisor. These 12-bit codes will, however, 
normally be mapped into the six-bit subset by the supervisor 
unless special action is taken by the user program to 
prevent the napping. Supervisor calls (SETBCD and SEIFUL) 
ara available for turning on and off the mapping. 

In tha CTSS Character Set table below, the 6-bit subset is 
contained in the upper half of the table. When a character 
from the lower half of the table appears in an input stream, 
it is mapped according to the following rules: 

1. Characters in the table enclosed in parentheses 
are discarded. 

2. All other characters except coasercial at, number 
sign, guesticn mark, and double quote are 
truncated to six bits ty discarding the left six 
bits. 

3. number sign (#) is the "erase" character: the 
previous character is discarded. Double quote (") 
is also an "erase" character. 

U. Commercial at (3) is the "kill" character: the 

entire line is discarded. Question mark (?) Is 
also a "kill" character. 

To simplify the job of a program which wishes to do its own 
12-to-6 bit mapping, the supervisor on input inserts a flag 
bit (tha fourth from the left) on those codes which are to 
be discarded upon mapping. For example, tha 12-bit code for 
tha percent sign, according to the table, is: 

C00CO10CO1C1 (0105 octal) 



CTSS PROGRAMMER'S GUIDE Section AC. 2.01 12/69 2 

When using the RDFLXA supervisor call, the code which will 
b2 received by a user program will be: 

CC0101000101 (0505 octal) 

since this character is discarded when mapping to six-bit 
moia. Tha flag bit is optional on output characters. For 

example, to type out a percent sign, either code 0105 or 
0505 is acceptable. 

PS.vice Code Tables 

Mo one device is capable of input or output of the complete 
CTSS character set. For each device, a table is provided 
which lists the exceptions. In most cases, these tables 
iniicata one of two mapping rules for exceptional 
characters. These rules are: 

1. The character is discarded on output, or 

2. The character prints as some graphic different 
from standard. 

Tha fact that a different graphic is attached to a given 
code does not of course, imply that the code will be 
intarprsted differently by the computer- This latter 

comment oust be kept in mind when using a 1050 or 2741 
console, which may have any of several slightly different 
sets of key caps and/or printing balls. 

On tha Model 35 Teletype and the Telex, the upper and lower 
case letters are mapped together as in the following 
axample : 

1, On input, a typed letter "A" will always produce 
the code fcr upper case "A", 0021. 

2. On output, the code for lower case "a"* 0121, will 
type an upper case A. 

Character C ode Ta bles 

Unassigned positions in the CTSS character set table are 
rasarvad for future expansion. At present, these unassigned 
characters are discarded on output. In the individual 

davica code tables, a lack of an entry implies that the 
corresponding entry in the CTSS character set table applies. 
Tha entry "ig" means that this character code is ignored on 
output to this device. 

All codes are given in octal. 



I <-x . ^ r\ 



CTSS EBCGRAMMEB'S GUIDE Section Ai;.2:.ui iz/o^ 



Abbreviations used in the character set tables: 

ig - Ignored (see comment above) 

WHU - Who are you 

P-off - Printer off 

P-on - Printer on 

V.T« - Vertical tat 

N.L. - Mew line (Carriage return and Line feed) 

L.F. - Line feed 

F. F. - Form feed 

tab - Horizontal tabulation 

hang - data phone disconnect 

sngl - Single space carriage on return 

dbl - Double space carriage on return 

L.K. - Lock keyboard 

O.K. - Unlock keyboard 

back - Back space 

BBS - Black ribbon shift 

BBS - Bed ribbon shift 

CBK/ - Carriage return without line feed 

A.M. - Alternate mode 

HLF - Half-line forward feed 

HLB - Half- line reverse feed 

ESC - Escape 

ACK - Acknowledge 

NAK - Negative acknowledge 



CTSS PROGRAMHER'S 3UIDE Section AC. 2. 01 12/69 4 

3TSS Character Set 



0000 1 2 3 U 5 6 7 

0010 8 9 = • 

0020 + A B C D E F G 

00 30 H I - ) : 

OOUO -JKLMB/SP 

00 50 C B F.F. $ ♦ S. L. null 

0060 blank / S 1 U V H X 

0070 Y Z tab , { 

0100 (!) (]) (\) (;) (*> (») (») (i-^O 

0110 (HLF) (HLR) D (bell) (!) (WBO) (hang) (P-off) 

0120 sabcdefg 

0130 h i (BRS) (BBS) (-") back (CH^7) " 

01U0(J 3 k 1 m n o p 

0150 q r (<) ([) (ESC) (>) ? 

0160 • (L.K.) s t a V w X 

170 y z (V.I.) ({ ) (}) (P-on) (O.K.) (A.H.) 



NOTES 



1. Character cades in parentheses are discarded on 
input in 6-bit mode. In 12-bit mode these 
characters have (400)8 added to them, as a flag 
bit. 

2. Character codes 0137 (double quote) and 0104 

(number sign) are the erase characters in 6-bit 
mode . 

3. Character codes 156 (question mark) and 0106 (at 
sign) are the kill characters in 6-bit mode. 

H. The codes 00 17 (Interrupt), 0057 (Quit) and 0077 
(Hang-up) on input are intercepted by the 
supervisor and are never sent through to the 
prcgrau. 



CTSS EBCGBAHMER'S GUIDE Section AC.^.UI l//6y tJ 

Model 37 Teletype Character Set 
Sama as CTSS Character Set except as noted below: 

1 2 3 Ji 5 6 7 

0000 
00 10 
0020 
0030 
0040 
0050 
0060 
0070 

0100 

0110 

0120 

0130 

0140 

0150 

0160 (NAK) 

170 (ACK) ig 

NOTES: 

1. Gn early aodel 37»s, codes 0107 (line feed), 0110 
(HLF) and 0111 (HLR) are ignored on output. 

2. Code 107 (line feed) cannot be input. 

3. Code 0117 (Printer-of f ) cannot be input. 

4. Code 0175 (Printer -on) cannot be input. 

5. Code 0017 (Interrupt) can be generated by one push 
of the "interrupt" button. 

6. Code 0057 (Quit) can be generated by two pushes of 
the "interrupt" button. 



CTSS PROGRAMMEB'5 GUIDE Section AC. 2. 01 12/69 6 

1050/274 1 Character Set 
Same as CTSS Character Set except as noted below: 

1 2 3 U 5 6 7 

0000 
0010 
0020 
0030 
0040 

0050 ig 

0060 
0070 

0100 ig <*) 

0110 ig ig (-•) ig ^9 

0120 

0130 ig ig 

0140 

0150 ig (prefix) 

0160 ig ig 

0170 ig ig ig ig ^"5 



NOTES: 



1. Interrupt and Quit signals are generated by the 
"Attn" key on 2741 »s and the "Beset Line" button 
on 1050«s 

2. Cede 107 (line feed) cannot be input from a 2741. 

3. Code 0154 (prefix) cannot be input from a 2741, 

4. Code 117 (printer off) cannot te input. 

5. Cede 0132 (black ribbon shift) cannot be input. 

6. Code 0133 (red ribbon shift) cannot be input. 

7. Code 0175 (ptintet on) cannot be input. 



CTSS PBCGRAMMRR'5 RU IDE Section AC. 2-01 12/69 7 

Standard Model 35 Character Set 
Same as CTSS Character Set except as noted below: 

12 3 4 5 6 7 

0000 
0010 
0020 
0030 
0040 
0050 
0060 
0070 

0100 

01 10 ig ig ig 

0120 A E C D E F G 

0130 H I ig ig ig ig 

UO J K L M N j3 P 

0150 Q B ig 

f\ ^ ^ r\ 1 — r« tr\ ri IT T3 V 

0170 Y Z ig ig 



NOTES: 



1. Some outside (i.e. not new-style MIT-iBcdif ied) 
model 35*s will not respond to code 0176 (Keyboard 
unlock) . 

2. Cn outside model 35's, code 0055 (Carriage return) 
will cause a Carriage Return and a Line Feed on 
output. Ihe computer will type a line feed 
whenever a carriage return is detected on input. 

3. On outside model 35 *s, the tabulate character 
(0072) prints as a back slash and will not cause 
tab motion of the carriage. 

U. Interrupt and Quit signals are generated by the 
••Break" button. 



CrSS FBCGPAMMER'5 GUIDE Section AC. 2. 01 12/69 8 

Telex Character Set 

Sdoia as CTSS Character Set except as noted below: 

12 3 4 5 6 7 

0000 

001 : 

0020 & 

0030 bell 

OOUO 

0050 ig * 

0060 

0070 ; 

0100 ig ig ig ig ig 

110 ig ig ig ig ig ig 
0120 A B C D E F G 
0130 H I ig ig ig ig 

OIUO igJKLHlJiaP 

01 50 Q R ig ig ig ig 

0160 ig ig S T U V S X 

0170 Y Z ig ig ig ig ig ig 



NOTE: 



1. Code 0115 (Mho Are Xou) prints a Haltese Cross. 

2. Either code 0035 or code 0113 will ring the Telex 
bell on output. On input, a bell produces code 
0035. 

3. Either code 0072 or 
seaicolon on output, 
produces cede 0072. 

n. Either code 0020 or 

ampersand en output. 

produces cede 0020, 
5, Either code 005U or code 0104 will print a number 

sign on output. On input, a number sign produces 

code 0054. 



code 


0103 will 


print a 


on 


input, a 


semicolon 


code 


0120 will 


print an 


on 


input, an 


aipersa nd 



(END) 



CTSS ?ECGP. AMMER • 3 GUIDE Section x\C.2.02 12 '69 



Spa::ial console characters 

Purgoss 

When working at the console, there are several significant 
signals or characters which the user finds necessary. The 
"braak character" is necessary to signal the end of a line 
so that the supervisor knows that it is time to analyze the 
lina to determine whether or not action is required. The 
"interrupt signal" is useful for the user to signal his 
program that the pre-planned branching within the program 
should new be followed. This might be analogous to sense 
switch interruption during batch processing. The "Quit 

signal" signal is used to stop the current program (by 
placing it in dormant status) and return the user to the 
command level. The "erase character" is interpreted before 
the line is processed by the supervisor and it causes the 
immediately preceding character to be erased by moving the 
character pointer or counter back one. The "line-kill 
character" is alsa interpreted before the line is processed 
by the supervisor and it causes the deletion of the current 
1 i n a . 

^£5.ill_^haracter 

The break character is a carriage return. Whenever a user 
typ3S into his console, regardless of whether or not his 
program is running, the input character is received by the 
supervisor within 200 ms. The input character is added to 
tha usar's input message and if it is not a break character, 
no further action is taken. If the character is a break 
character, the message is called complete and one of several 
actions results. 

If the user was at ccmmand level (i.e., the user was in dead 
or dormant status) , he is placed in waiting command status. 
If the user's program was in input- wait status, it is 
raturnad to working status so that it may resume by reading 
tha input message. If the user's program was already in 
working status, the message is merely considered early and 
is left in the buffer for subsequent reading by his program. 
(If early messages continue to arrive and the input buffer 
araa bacomes nearly filled, a message is typed out to the 
user requesting that he stop typing until his previous input 
is read .) 



^uit_and_Interru^t_s iqnals 

Whan a program is first initiated or placed in working 
status it is said to be at interrupt level 0. This applies 
to both commands and user programs. The program continues 



CTSS PROGRAMMER'S GUIDE Se::tion AC. 2.0 2 12/69 2 

execution until it teminates by entering dead or dormant 
status or until the user transmits the CUIT signal which 
places the program in dormant status immediately. This 

»,„„,i -ifiTT cwtpai ali'wc: the user to change his mind, 
correct iristakes, etc. 

Interrupt signals may be used by the user to externally 
direct or control certain pre-planned phases of his programs 
:»x=»-'ution. These interrupt breakpoints nay be recursively 
stacked to a maxiniuni depth of 3. Whenever a console 

intsrrupt signal is received by the supervisor, control is 
returned (by means of a push down list) to the entry 
previously assigned. Interrupts are dealt with within a 
user's program by means of subroutines SETBBK, GETBRK, and 
SAVBRK (AG. 6. 03) . 

The interrupt signal is generated when the interrupt key is 

pushed once (ATTN on 274 1, RESET LINE on 1050, BREAK on 

model 35, INIEHKUPT en model 37). The quit signal is 
ganaratad by pushing the button twice within two seconds. 

EEase_and_Kill_Cbaracter£ 

A console operating at command level is automatically set to 
the normal mode cr 6-bit BCD code. (A program call to the 
suparvisor is necessary in order to change to the 12-bit 
typing mode). While inputting in the normal mode, two 
sp='cial characters are recognized before the message is sent 
to the supervisor. The characters " (quote) and # (number 
sign) are interpreted as a single character eraser. This is 
iccomplished by moving the character pointer back one space 
instead of forward, within the current line or message. 
Tharafore, n quotes or number signs will erase n characters 
(not counting the quotes themselves as characters) back to, 
but not including, the previous carriage return or break 
character. The ? (question mark) and the a (commercial at) 
ara interpreted as a line-delete signal. The entire aessage 
back to the previous break character is erased. 



(END) 



r-t'cc DonnDAMMPutt: -^rrnp c.•Qr-.^-i/-^n hr 1 lj/*va 



Identification 

Data phone extensions 

Consoles may be connected with the 7094 via telephone lines 
through the data switch. Because of the differences in 
transmission rates between various types of consoles, there 
are several classes of lines: 

1050/27U1 Dial 'O* 

35ASE/KSB Dial 'g* 

3 7KSR Dial '1371 • 

ABDS display Dial • 160 !• 

All of these numbers are 'hunt groups', i.e. they cause the 
telephone exchange tc search over a number of lines until 
one is found which is not busy, 

Consolas have specific (although not necessarily unique) 
identification codes. These codes are to be used with the 
attached remote console supervisor entries; thay are also 
checked by LCGIN for unit group restricted users. The 

console ID word consists of a type code {2 for 1050, 3 for 
TELEX, 4 for rWX', 5 for inktronic and 3 3K SR , 6 for 
3bASR/KSR, 7 for 37KSR, 8 for 27U1, 9 for ABDS) , two to four 
BCD 73roes, and one to three BCD characters of 
identification, for a total of six characters. 

Each data phone used with a console has a unique extension 
number which may be used for voice transmission. A data 
phone may be called from another data phone by dialing the 
U-digit extension number, or from an MIT extension by 
dialing 818 followed by the data phone number. Note that 

data phone extensions are net regular MIT extensions. 

If your console or data phone needs service, call MIT Ext. 
4128, giving name, ro3m number, console type, and nature of 
the trouble. The appropriate repairman will be notified; 
tha racord of the trouble is kept until the repair is made 
and reported back by the serviceman, 

A recorded message giving the current status of CTSS is 
available at data phone ext. 1300. If an abnormal systetn 
comadown (crash) dccucs, and CTSS will fce down for more than 
10 minutes, the operator will update the recording 
indicating expected comeup time and the nature of the 
trouble. 



(END) 



CTSS £ PCGH AW.M ER* S GUIDE Section AD-1 9/65 1 

li^ntifi cation 
Historic file system 
Purposa 

The IBM 1301 disk served as the bulk storage for the time 
sharinj system sc that users files, system files and 
sub-system files could be quickly and randomly dumped and 
read. It was extremely important to have a flexible but 
afficiant and usable central module which would handle all 
the disk input and output for all users. The following 

iiaas were incorpDrated in the disk control subroutine which 
was used for about a year and a half. In August of 1965, 
tha old disk control subroutine was replaced by a new module 
whi::h incorporated many improvements, but also allowed for 
much upward compatibility for the old system. The old 

system will, therefore, be described here because of all the 
routines and write-ups which are still using the 
:;ompatibility features. 

Considerations 

The following considerations went into the make-up of the 
fil3 system and they might help in the understanding of the 

system. 

1. The user should be able to write and maintain 
pernanent programs and data files on the disk. 

2. System and subsystem programs should be 
permanently recorded on the disk. 

3. The user should have only symbolic reference to 
his files. 

4. The user should be able to read and write many 
files simultaneously. 

5. The user should not be able to reference any files 
not authorized to him. 

6. The user should be able to initiate files in 
different modes such as temporary, permanent, or 
read- only. 

7. In order to utilize the maximum storage capacity 
of the disk file the format of a single record per 
track should be used. 

££OiS.S.li.on 

During time- sharing, all systems and users make use of the 
single standard input/output package. It a system dees not 
use the standard routines, it can be run ty itself with the 
iisk inoperative or if it needs the disk, the contents of 
the disk can be dumped and later reloaded when time-sharing 
is restarted. During time-sharing, the standard package 
mikas use of input/output trapping and memory protection to 
insure protection of user's programs ind files. The user 



CrsS FPCGRAKMER'3 GUIDE Section AD.1 9/65 2 



has accass only to files which are authorized to hiir. 

A furthar protection against loss of files is the 
Operational procedure of duinpirig the contents of the disk 
filas periodically onto tape. These durep tapes can be used 
by a retrieval program tc reload the disk completely or 
S3l2ctively. These history tapes are kept on file by 
operations according to a schedule which is approximately: 
diily tapes for a week, weekly tapes f or U months and yearly 
ta'ies forever. In case cf a manor unrecoverable catastrophe 
the entire system may be backed-up 2U hours by reloading the 
most racent dump tape. The user may recover any of his 
individual files fron: any cf the tapes which contain them. 

File Structure 

Eich user is assigned one or more tracks to serve as a 
directory of all his private files currently stored on the 
iisk, A user does not have access to any other user's file 
directory. A group of users *ho may be working on the same 
problem may be assigned an extra set of file directories 
(called coDPiTiOn files) to which all the users of the group 
have access. 

The old system had two%severe limitations: first, only one 
usar could be working in a file directory at any one time, 
and second, that a reference to a single file could exist 
only in a single file directory. These limitations meant 
that in order to share routines or data, users had to copy 
filas into and out of common files, so that there were 
multiple copies cf the same file. Furthermore, whenever one 
user was using a common file, no one else had access to it. 
Thsss limitations have been much alleviated with the new 
system. 

The file directories contain the two BCD word names, the 
number of tracks used, the starting track address pointer, 
the date- last- used, and the mode of each file. A master 
fila directory is maintained which contains a pointer to the 
file directory of each user in the system. A track usage 
tible is also maintained which tells the system which tracks 
are already used and which are free. All the tracks of a 
single file are chained together by virtue of the first word 
of aach track either pointing to the next track in this file 
or to the last word cf this track if thare are no more 
tracks. Whenever possible, the tracks for one file are 
assigned consecutively, in order to reduce the time lost in 
saaking. When the disk is reloaded from the dump tapes, the 
housekeeping is done to provide consecutive tracks for 
filas which might previously have been scattered. 



rpc^c; PwnaB A MMRR • S "ITDF. 



Ssr: t-i on AD . 1 



9/65 



Usa^a 

All filas are 
absolute ttac 
saquencas to 
allowing the 
i:;::;apt the st 
calls and ecr 
this manual 
wcite-arcund 
will behave i 
1965. Note t 
the sections 
by an *. 



cefetred to by a two word BCD name and nc 
k locations are known or needad. All calling 

the disk routines provide the facility of 
user to specify his own error procedure ar 
andard system error procedure. All of the 

or procedures are described in section A3 of 
Almost all of these ::alls will have 
routines for the new I/O system so that they 
n much the same way as they did before April 
hat in the table of contents of this manual, 
which refer to the new I/C system are preceded 



(END) 



CTSS PHOGRAnnEH'S 3 LIDE Section AD, 2 12/69 1 

LileBiilicaticjn 

Tha naw file structure and Input/Output system 

Pur£ose 

The new file system was implementei , 1) in order to continue 
the basic philosophy of the previous file system and remove 
many of the weaknesses which had become evident in its years 
of 3X3rcise and 2) to provide and exercise a prototype of 
the file system which is proposed for the next time sharing 
system. 

Soma improvements to be found in the new system will be 
mentioned here, and it is assumed that the reader is 
fimiliar with the previous file system discussed in section 
AD.1. The I/O system can accomodate any configuration of 
I/O channels and/or devices and thereby provide a standard 
intarface to all users. The fcack-up feature, of having 
files duuped onto tapes which can be saved for retrieval, 
will be accomplished by a DAEMON which is in constant 
operation during time sharing. In this way the amount of 
information which is dumped and the amount of time lest due 
to back-up will be greatly reduced. The I/O system can now 
deal with entries in file directories which are pointers 
(LINKS) to entries in other file directories rather than to 
the files themselves. This means that a user may perait 
othar users to use any of his files without actually copying 
the desired files into other directories. Thus, many users 
miy be referencing files within the same directory, 
simultaneously. Indeed, many users may be reading the same 
fil2. A lock does exist so that no one may reference a file 
which another user is altering. A further improvement is an 
increase in the number of modes which files may have. 
Additional entries have teen added to the I/O system to 
allow the administrators to update the master file directory 
during time sharing operation so that new users can be 
placed in the system more quickly. The I/O system is 

modular for all machine dependent sections. By replacement 
of certain modules, different strategies tor particular I/O 
ia vices, or I/O devices themselves, may be changed without 
affecting the overall I/O structure. 

§ t£ uc t ur e_gf _ t h e _ I ^0 _ Sis t em 

The I/O system presents a standard machine independent 
interface to all users. All calls to the I/O system are 
directed to the basic control module of the system called 
th3 File Coordinator. The file Coordinator then requests 
service from the Buffer Control Module, which in turn may 
request service from a particular Strategy Module. Attach 

Strategy Module is concerned only with a certain class of 
information storage. The Strategy Module may in turn 

request service from an I/O Adapter. The I/O Adapter is a 



CTSS PHOGRAMrtER'S SlilDE Sa:::tion AD-2 12/69 2 

module which ftocesses input and output reLjuests for 
sp3:;iEic I/C devices. All calls to the I/O system 

requesting input ot output must follow this path of control. 

Module- an I/O Adapter. 

The File Ccordinatot: 

The File Coordinator provides the interface between the file 
system and the user. It interprets the calling sequences, 
performs validity checking cf the calls, and calls the 
appropriate module. 

Tha Buffer Control Module: 

Tli3 Buffer Control nodule is called ty the File Coordinator, 
Its functions are to maintain the user's active file status 
tibia parameters, to convert the user's calling sequences to 
appropriate I/O commands for the stategy modules, and to 
oiova tha data words between the buffers and the user's data 
storage area. The Buffer Control Module in turn calls the 
appropriate Strategy Module when I/C is needed. 

Tha Strategy Modules: 

Each Strategy Module is responsible for a particular storage 
device. This module determines tha strategy to be used in 
iaaling with this storage device and its associated I/O 
Adapter. Bequests are stacked in queues to be executed by 
the I/O adapter whenever tha associated channel beconies 
fraa. In addition, the Strategy Module is responsible for 
keeping track of the number cf available units of secondary 
storaga for the device to which it is assigned. Requests 

are made to the Strategy Modules only through the Buffer 
Control Module. 



Tha I/O Adapters: 

Tha I/O Adapter is responsible for the operation of the 
hardware interface tc a particular device or devices. The 

I/O adapter accepts requests for service from the Strategy 
Modules only. The I/O adapters are rasponsible for 

pro::assing all traps associated with the devices to which 
they are assigned. The I/O adapters interrupt the 

appropriate Strategy Modules upon completion of previous 
ra quests. 

Operation of the. Buff er, Cgntrol_Modul3 

Tha buffer control madule (BCM) is called by the file 
coordinator and its function is twofold: 1) maintain the 
usars active file status table parameters of file length, 
reading and writing status and pointers, buffer status and 
pr»niing I/O, and 2) canvert the user's calling sequence into 



are 

no 



CTSS PSQGRAHHEH 'S GUIDE Section AD. 2 12/69 3 

appropriate calls to the I/O adaptac for physical J^^cords 
and move data between the buffers and the user's data area 
on a word basis. 

Whanevat possible, data is moved directly from the I/O 
device into the user's data area without going through a 
buffer. In the general case, however, a buffer itust be 
supplied for intermediate storage for those parts 3t the 
data which do not camprise a complete physical record on the 
I/O device. seme users may wish to devise more 

sophisticated I/C control when the system efficiency is 
considered unsatisfactory, so the following conditions are 
notad where files may be dealt with without providing a 
buffer. For example, a multiple buffers system may be built 
in the user's prcgram without extra buffering by the system. 

Reading without a buffer: 

If blocks of integral number of physical records 
read or if reading goes through the end of file, 
buffer will be used even if one is assigned. 

If no buffer is assigned and partial records are called 
for, the physical record will be read for each call in 
order tc extract the logical or partial record from the 
ph ysical . 

Writing without a buffer: 

A complete new file of any length can be written by a 
single call without a buffer being assigned. 

An existing file may be written into without a buffer 
only from the beginning of a physical record through 
the end of a physical record or through the end of a 
file. 

Appending to a file or writing partial records requires 
a buffer. 

Truncation without a buffer: 

Truncation without a buffer can only be accomplished if 
the truncation word is beyond the end of file or m 
front of the first word (file made eapty) . 

Th- BCM selects an appropriate strategy depending on 
whether a buffer has been assigned or not and returns 
an error if a buffer is mandatory where none was 
assigned. A user may switch a file from "no-buffer 
lode to "buffer" mode or vice-versa by calls to BUFfER. 

File Notaticn_and_3 true ture 



TSS PHOGHAMMER 'S 3UIDE Section AD. 2 12/69 



Tlie smallest piece of information which can be manipulated 
by tha I/C system is an element. A file is an otdeted 
sequence of elements. The file is the largest amount of 
intocmation which can be m anirnjlat ed by the I/C system, 

Evary fila will have a unique name which is used to identity 
that file to the user. An element in a file is referenced 
by specifying the tile name and the linear index. For 
axampla, the element "i" in file "a" is referred to as a (i) . 
Files may be created, modified or destroyed by a CTSS 
projram only through the use of the I/O system. 

A fila appears to the user to be a block of contiguous 
storage which may be referenced through normal sequential 
ailressing conventians. However, the physical structure of 
th3 fila is independent of the logical structure which the 
user experiences. The user may refer to a file only through 
tha symbolic file name and should have no notion of where or 
how the file is stored. The number of elements which make 
up a file is arbitrary, and in fact a file may exist with no 
elements. 

There are four basic operations for manipulating elements 
within files: opening, closing, reading and writing. To 
initiate a read and/cr write operation, the file must first 
b=; opaned for reading and/or writing. To terminate the 
raading and/or writing of a file, the file must be closed. 

Modes: 

A characteristic of every file is its mode. The aiode of a 
fila is specified by a 7-bit mask at the time it is created. 
(The mode may be changed later if desired.) Each bit in the 
mask indicates a different property of the file, and any 
combination of properties may be specified. The properties 
and tha (octal) mask bit positions are shown below. 

000. PERMANENT- If all bits in the mole mask are zero, 
the file can be read or written, and will be stored 
indefinitely. 

001. TEMPORARY- Such a file will automatically be 
deleted the first time it is read. The deletion 
will not take place until the file is closed after 
reading. 

002. SECONDARY- This property appears in directory 
entries far files which have been deleted by 
storage collection mechanisms. The entry is 
retained for purposes of identification. 

004, HEAE-ONLY- The file can only Le read. An attempt 

to write into or delete a file of this property 
will cause an error condition. 



CTSS PROGKAMMER'S 31JIDE Section AD. 2 12/69 5 

010. WBITE-OMLY- The file can only be appended tc. An 

attempt to read from or delete a file with this 
property will cause an error condition. 

020. PBIVATE- The file can only be referenced by the 
AUTHOR i.e. the user who created or last modified 
this file. An attempt to delete a file cf this 
property will cause an error condition. 

040. Unused node bit. 

100. PROTECTED- The mode of the file may only be changed 
by the AUTHOR of the file. Any attempt by another 
user to change the mode of this file will result in 
an error condition. A 'PROTECTED' file may not be 
renaned nor deleted, even by the AUTHOR. 

File Directories: 

The File Coordinator may service requests from a fixed 
number of active users. Requests from a specific user are 
in the form a (i) , to reference the element "i " in the user's 
fila "a". The File Coordinator however, manipulates 

information by use cf an implicit address of the form 
:;(b(a(i))) . This address references the element "i " in the 
file "a", which is specified by the file "b", which in turn 
is specified by the file "c". The file "c •' in this case is 
a specific Haster File Directory and the file "b" is a 
specific user File Directory. After establishing a "c" and 
"b" pair, each successive call for a (i) will then be 
interpreted by the I/O system as c (b (a (i) ) ) , until another 
nil is given specif ing a new "c" or "b". By treating the 
user file directories and the master file directories as 
normal information files, multiple usage cf single files can 
be accomplished in a general manner. 

The formats of the Master File Directory and the User Pile 

Directories are shown on the next page. The groups of words 

1-7 actually begin in the fourth word of the file and are 

repeated in the groups of seven for each entry in the file. 

An entry in which both of the first two words are zero, 
maans that an entry has been deleted. 

Tha dates are of the format: bits S,1-8 ::ontain the year 
-400 modulo 500, bits 9-12 contain the month, bits 13-17 
contain the day, and bits 18-35 contain the number of 
seconds elapsed since midnight. 

Tha AUTHCR is the programmer number of the user who created 
or last modified the file. The F is a 3-bit integer which 
sp3:;ifL:js on which secondary storage device the file 
resides. If F is O, the entry refers to a linked file. F 

IS used by the Buffer Control Module to determine which 



CTSS PHOGRAMMER 'iS GUIDE Section AD. 2 12/69 



strategy module should be called 



RCOUNT specifies the number of elements contained in a 

physical records contained in the file. LCOUNT specifies 

tha number of elenents contained in the last physical record 
of the tile. The highest element address in a file may be 
dafined as (NDRECS-I) ♦ R30UHT ♦ ICOUMT. The 3-bit integer 
P is normally one. Hawever, P=0 is equivalent to P=1. 

I LOCK is used to allow multiple users to access the same 
file simultaneously. If a file is in read status, ILOCK 
contains a count of the number of users currently reading 
from that file. When the number of users reading from the 
fila drops to zero, any user who wishes to modify that file 
will be allowed to proceed. When a file is opened for 
writing, the high order kit of ILOCK is set to 1. Curing 

the time that ILCCK indicates that a modification to a file 
is in progress, no new users will be allowed to reference 
that file. 

IE user "A" wishes to reference a file contained in some 
other user's file directory (user "B") , he can accomplish 
this by means of a "LINKED" file. A LINKED file is defined 
in a user's file directory as a file with a device 
specification of zero (F=0) , 

If a file in a user's file directory is a LISKED file (F=0) , 
KCOUNT, NOBECS and ILOCK are ignored. The problem and the 
programmer number of the user to which the link is made are 
in words 3 and 4. The name of the file being linked to is 
in words 6 and 7. A file may be linked in this manner 
through the file directories of several users. The depth of 
linkage is currently restricted to 2. The last entry must 
ba a normal file directory entry which defines the file in a 
normal manner. Once this linking operation is completed, 
tha file will be treated as a normal file. This operation 
will be repeated every time a user attempts to open a LINKED 
file. 

The user may refer to his file directory as a file of the 
nima "U. F. D. (FILE)" which is defined in his file directory 
as a norsal file in READ-ONLY mode. The Master File 

Diractory is defined as a User File Directory by the name 
"M.F.D. (FILE)" in the Master File Directory. This file is 
also referred to as "U.F.D. (FILE)" within the Master File 
Diractory. To read the Master File Directory, first, 
ATTACH. ($M .F.D.$,$ (FILE)$) . The I/C system will never 
illow the Master File Directory or any User File Directory 
to be deleted. 



PT^m PBrR RAHM KB»=; RIIIDI Section AD-2 12/69 



MASrEB FILE DIRECTORY, "M.F.D- (FILE)" 



WORD CONIENTS 



PBCELEM NUMEEK (36 EITS) 

PROGRAMMER NUMBER (36 BITS) 

AND TIME any file in U.F.D. LAST MODIFIED (36 BITS) 

LAST USED (18 BITS), AUTHOR (18 BITS) 

(8 BITS), (10 BITS) ,F (3 BITS), BCOUNT (15 BITS) 

(3 BITS), NORECS (15 BITS), P (3 BITS), LCOUNT (15 BITS) 
next "P" words contain specific information for a file 
of type »F". 



1- 


USER 


2. 


USER 


3. 


DATE 


4. 


DATE 


5. 





6. 





7. 


The 



USER FILE DIRECTORY, "U-F.D. (FILE)" 



W3RD CONTENTS 



NAME, PART 1 (36 BITS) 
NAME, PART 2 (36 BITS) 
AND TIME LAST MODIFIED (36 BITS) 
LAST USED (18 BUS), AUTHOR (18 BITS) 

(8 BITS), ILOCK (10 BITS), F (3 BITS), BCOUMT (15 BITS) 
|3 BITS), NORECS (15 BITS), P (3 BITS), LCOUNT (15 BITS) 
next "P" words contain specific information for a file 
of type "F". 



1. 


FILE 


2. 


FILE 


3. 


DATE 


u. 


DATE 


5- 


MODE 


6. 





7. 


The 



CTSS EPCGRAMMER'S GUIDE Section AD. 2 12/69 8 



2302 Disk and 7320 Drum Strategy 

Th3 £ile directory entry for a 2302 or 7320 file contains 

puXU*^*:Ji.o uu cut: j. x i. o i. a uu xa w u cxaorv^* l \j a. « i. x x c:: vyx ^.iixo 

typa , RCCUNT will be the numfcer of data words in a single 
track. NDBECS will be the total number of tracks in the 
fila and LCCUNT will be the number of data words in the last 
track. 

Each track in a file of this type will contain chain address 
pointers to the following and preceding tracks. In addition 
each track will contain a label in the following fora: 

I LCOJJNT I TRAKNC_ I 
S 35 

TRAKNO is a track sequence number. LCOUHT will be non-zero 
only in the last track of a file and will contain the count 
ot tha number of data words in that track. This count must 
match the value of LCOUNT in the user file directory for 
that file. 

Tracks are assigned in a manner similar to that described in 
mamo CC-196 (Disk Control Routine) . All track usage tables 
will be files contained as entries in the Master File 
Diractory. The file which defines the usage of disk tracks 
will be referred to as "DISKUT (FILE)", The track usage 

fila for the 7320 drum will be referred to as "DHUMUT 
(FILE)". 

2302 Disk and 7320 Drum I/O Adapter 

The disk/drum Strategy Modules provide calls to the 
lisk/druffl I/O adapter specifying only logical track 
addresses. The I/O adapter is responsible for determining 
tha actual channels which must be used. The adapter places 
all requests into a request queue and returns. The trap 

processor for the disk/drum I/O adapter empties the request 
quaue on completion of previous requests for that channel. 
If a request is made requiring a channel not already in 
operation, a trap will be simulated for that channel. 

Tip3 Strategy Module 

Ma;jnetic tapes will be treated as secondary storage in the 
same manner as disks or drums. Many files can be recorded 
on a single tape, but a single file may not consist of more 
than one tape. The first physical file of a tape file will 
bi a BCD header label (see Section AG, 5. 05). 

In a file directory entry for a tape file, ECOUNT will be 
1*32 and E will be one. The seventh word of the file 

iiractory entry will contain an internal tape address known 
to tha I/C supervisory systems only; this word contains a 



C'i'SS FEGGHAMM E5* S GUIDE Section AD. 2 12/69 9 



logical unit number and a file number. Cther information in 
tha fila directory entry has the same meaning as described 
in the disk and drum Strategy nodules. 

Each data record will contain 432 information words preceded 
by a control word in the following form. 

PZE REGNO, ,LCOUNT 

RECNC will be the recard sequence number. LCOUMT will be 
non-zero only in the last record of a file and will be the 
count of the number of words in that record. This word 

count must match the value of LCOUNT in the file directory 
antry for that file. 

Tha I/O adapter for the tape Strategy Module will operate on 
request queues in the same manner as the disk and drum I/O 
adapters. 

To use Tape Strategy, a user must have an 

ailministratively-assigned tape record quota. Because the 

use of tapes makes unusual demands on both the system and 

tha oparators, assignment of such quotas will be the 
exception rather than the rule. 



Usa_ye 

Nota three things in particular about this I/O system. 
First, it is basically not a buffered system so that upon 
raturn from BDFILE or WRflLE it is safe to assume that the 
I/O has not actually been done yet. Before the specified 
lata area may be referenced, a call to FCHECK and a 
"finished" return must be made. In other words, before a 
satisfactory delay has been made by FCHECK, the input data 
is not really there or the output data has not yet been 
transmitted sc the user may not rewrite tha data area. The 
sacond thing of note is that if an error return is 
specified, some errors are detected immediately and some are 
not detected until the next I/O call. Each BDFILE or HRFILE 
serves as an FCHECK en the preceding RDFILE or WRFILE on the 
sima file. The third thing to note is that all of the I/O 
is considered to be by relative locations so that all files 
can be considered to be similar to addressable storage. 

Calling Conventions: 

Following is a list of calls to the new file system. The 

detailed write-ups of these calls can te found in section AG 
and in the table of cantents their sections will be preceded 
bf an *. Their calling sequences are given in MAD notation 
and the MAD compiler has been modified slightly to accept an 
intagar or an integer -v ariable specifying the nuitber of 
words in block notation rather than the last address of a 



CTSS EBCGBAHMER'S GUIDE Section AD. 2 12/69 10 



bLo:;k. The new file system is consistent in expecting the 
number of words rather than the last address in block 
notation. All arrays are stored forward so that the 

K<3 rj i n n i n n a H H r o c c tniict- ho +he T '^ HS *: + '"Qro lQr-At"ir»r» r» ^ i- ha 

array. Also, all file names are specified by the locations 
of both ECD names rather than the location of the first name 
as FILNAM is used in the old file system. The file names 
it2 right adjusted and blank padded. For example: 

MAD: FSriFE. ($ NABEIS, $ N AME2$ , A (8i . . . 8) 

FAP: TSX FSlATB,tJ 

rXH =H NAMEl 

TXH =H NAME 2 

TIX A,, EIGHT or TXH A, ,8 



EIGHT PZE 8 
A BSS 8 

In all of the calls, if an argument is not pertinent, a -0 
may be specified (FAP: PTH = -0) . All calls will accept 
two mora arguments than shown. The first is the location of 
users' error return and the second, if supplied, specifies 
tha location into which the error code will be stored. 

Soma of the arguments and information items are of special 
forms which might be noted here. 

DEVICE = 1, is low speed drum 

2. is disk 

3. is tape 
File status = 1. is inactive 

2. is open for reading 

3. is open for writing 

4. is open for reading and writing 



r-moo nanna k umOD * <z 3J]JDE S3CtLOn ADi2 12/69 11 

SUMMARY 

Aiministrative and Privileged: 

UPDHFD. ($ EBOB$, $ PROG$) 

DELMFD.($ PROB$, $ PR03$) 

ATTACH, ($ EBOB$, $ PBOGJ) 

MaVFIL. ($ NAME1$,$ NAME2$,$ PR0B$,4 PROG$) 

SETFIL.($ NAHE1$,$ NA ME2$ , DA YTI M,DATELU , MODE, DEVICE) 

LINK. {$!JAME1$,$NAME2$,$PR0BN$, $PROG$, SNMIS , $HM2$ , MODE ) 

UNLINK. ($ NAME1$,$ NAME2$) 

ALLOT. (DEVICE, ALLOT , US ED ) 

RSFILE.($ NAME1$,$ NAME2$) 

Raaiing and Writiag : 

OPEN.($SIAIDS$,S NAME1$,$ NAME2$ ,-HCDE-, -DEVICE-) 

BUFFER. ($ NAME1$,$ N AME2$, BU FF { 432) . . . t»32) 

RDFILE.($ NAME1$,$ NA ME2$ ,RELLCC , A (K) . . . N, -EOF-, -EOFCX-) 

RDWAIT. ($ NAH£1$,$ N AME2$, RELLOC, A (») N ,-EOF- ,-EOFCT-) 

WRFILE.($ NAME1$,$ NA ME2$ , RELLOC , A ( B) ... N, -EOF-, -EOFCT-) 
WRWAIT. ($ NAMEII. $ NAME2$, RELLOC, A (M ).,. N , -EOF- ,-EOFCT-) 
TRFILE.($ NAME1$,$ NA ME 2$ ,RE LLOC) 
FCHECK.($ NAMEIS, * N AM E2$ , FIN ISH) 
FWAIT. {$ NAME1$,$ NAME2$) 
CLOSE. (f NAME1$,$ NAME2$) 

othars: 

UPDATE. 

SETEHI. (PRIOR) 

RESETF. 

CHFILE.($ NAME1$,$ NAME2$, NMODE , SKEWNWU , $SEWMM2$ ) 

DELFIL. ($ NAME1$,$ NAME2$) 

ESTATE. ($ NAME1$,$ NA ME2$ ,A (8) . . .8 ) 

STOHGE. (DEVICE, ALLOT , USED ) 

MOUNT. ( CHAN , UNt T ,ME SSA3 (20) . . .20) 

UMOUNT. (UNITNO,MESSAG{20) ..,20) 

VERIFY. (UNI'INO,LABEL{a) ...U) 

LABEL. (UNIT NO, LABEL (4)... U) 

TAPFIL.{$ NAME1$,$ NA ME 2$ ,UNIT NO,FI LBNC) 

I0DIAG.(A(7) ...7) 

TILOCK. (RETRN) 

FEHRTN .(RETRN) 

ATTKAB (A(2)...2) 



(END) 



PTcc: cnrnnaMMRR*^ firiTnT sprf-ion AD.l 11/65 1 



Jisntif ication 

Library files 

2 Eli.lli.2i.ti on 

Library files are created by COMBINing BSS filas into files 
Hhirh maj then be searched for missing routines by the 
relocating leaders. Any user may create his own library 
filas and, by use 3f the special argunents, direct the 
loader to search his library files instead of (or in 
addition to) the CISS system library files. Subsystems of 
CTSS (3.g., AED) may have their own libraries and their own 
loaders. However, the ones being discussed here are the 
CTSS system library and loaders. 

Tha system library is currently divided into files which 
reside in the system common file directory. TSLIB 1 contains 
all of the standard routines described as library 
subroutines and library entries in this manual. The loader 
will normally search TSLIBI for missing routines unless 
prohibited by special arguments. TSLIB2 contains the 

debugging subroutines and core-B transfer commands. The 
lodier will search rSLIB2 automatically only when a core-B 
transfer conniand has been given. If the debugging routines 
ara to be loaded with the program before execution the 
loader should be informed by (SYS) TSLIB2 or, for example, 
mora completely by (HEID) FLEXPM (SYS) TSIIB2. A special 

library in the system file is KLULIB which contains 
subroutines for the "KLUD3E" (i.e., ESL scope console) and 
whi:;h may be searched if special arguments are given to the 
loader . 

The library files may be improved by any user by following 
tha maintenance procedure described in section AB.3. The 
library is naintained by the programming staff at the 
Computation Center. 



(EN£) 



CTSS PHOGRAMHER'S GUIDE Section AD. 4 12/69 1 

CotBmon Files and the Public Pile 
Purpose 

This section describes the nature of, and submission 
procedure for, prcgraiiis in the "Public File" — a file 
liractory accessible to all users of CTSS, To furnish 

perspective, the evolution of common files and the Public 
Fila is also discussed. 

Development_of _ Cgmmon_Files 

Within the former file system, a given file cculd be 
referenced from only one file directory and only one user 
:;ould be attached to a file directory. In practice, a group 
of users could be working on one problem and, therefore, 
have need to access a common pool of programs and data. 
This conflict was partially resolved by implementing the 
concept of coirmon files, where "common" implies some sort of 
"joint ownership". A group of users working on the same 
problem was assigned a single problem number. Each problem 
number could then have associated with it as many as four 
common file directories. Any user could switch from his own 
file directory to one of the common file directories 
associated with his problem number. With appropriate calls 
to the supervisor a user could copy any of his files into 
the common files or capy files from any of the common files 
into his own directory- Some restrictions still existed, 
namely, only one user could operate in a common file 
directory at any one time; to avoid locking users out of a 
common file, files had to be copied and, therefore, many 
copies of the same file existed; also, common files were 
rigidly associated with a problem number and therefore 
communication between problem numbers was impossible. (The 
currant treatment of common files is covered in Sections 
A3. 3. 03 and AH.6.0U.) 

The four comaon files associated with the system 
programmers' problem number took on the special function of 
servicing all users, regardless of profclen number. Their 

common file 4 became knofcn as the Public File and any user 
=ould put files there and copy files from there. In order 
to housekeep the system files, the Disk Editor, which was 
run at least once a day, deleted all files in the Public 
File which were in temporary or permanent mode. Only a 

system programmer could change a file in Eublic to the old 
file system's El or B2 mode (approximately Read-only and 
R^ad-only Protected) . A further restriction was placed on 
th3 Public File, namely, only programs which were adequately 
documented cculd reuain in Public. The documentation was 



CTSS PRCGRAMMER'S 3UIDE Section AD. 4 12/69 2 



available from the consultants. The system prcgra Bmers' 

common file 2 became known as the system File, common file 
S, and any user could copy files from there. Common file S 
contained the binary files of all the commands and the BSS 
filas of the libraries. The system programmers' comaon file 
1 contained the source and binary files of the supervisor 
and common file 3 contained listing files of the supervisor. 

Current_Contents_of_the_Public_File 

Tha Public File (M1416 CMFLOU) is a file directory with a 
track quota of zero, the contents of which are available to 
all users. It contains nothing but linkage pointers to 
filas which exist in Dther file directories. There are 

several reasons why these pointers must be placed in a 
Public File: 1) The Public File now also fulfills the role 
formerly played by the System Fi^e ; hence, certain files 
must ba made available through it to the programs which need 
them. For example, system libraries, TSLIBn BSS, are needed 
by th3 loaders. The actual BSS files reside in one of the 
other M1416 cowmen files (accessible by system programmers 
only) but leaders can read them through the links in the 
Public File. 2) Many commands and their data files are 
maintained by their authors rather than by the programming 
staff. These command and data files may reside in the 
authors* file directories but are made available to all 
usars of the system through links in the Public File. 3) 

Users have prcgams which are of general interest and 
usafulnass but which have not been given command status. 
These programs are made available to all users through the 
links in the Public File. 

Users^ Pr ograms 

A major advantage of a time-sharing system stems from the 
ability it offers for users to share software as well as 
hardware. This "talent -sharing" can easily go far beyond 
the power offered by the range of compilers and library 
routinss made available by batch-processing system programs; 
in some sense, every progaram on the disk could be thought 
of as a "system program". To facilitate exchange of users' 
programs, be they subroutines (for the documentation of 
which Section RI is reserved) or "commands" (the SAVED files 
which are documented in Section AJ) , the Public File was 
instituted. Inclusion of a program in the Public File both 
guarantees its accessibility to all users and, indeed, 
publicizes its existence to all (studious) readers of the 
Programmer's Guide. However, inclusion of a program in the 
Public File also implies a degree of sanction by the 
administrators of the system. Because of this "sanction", 
then, prograns which are submitted for inclusion in the 
Public File cannot automatically be accepted. Both the 

natura of the program and its documentation Bust be 
evaluated. To this end, the following submission procedure 



CTSS PBOGRaMMEB'5 GtlTDE Section AD.U 12/69 3 

has been developed. 

Sibmission_Erocedure 

Whan a candidate for inclusion in the Putlic Files has been 
debugged, the author should send its documentation to the 
alitor of this manual. There are two parts to the 

iocunantation. First, a typed (or TYPSET) write-up is 
required, in the general format of a section of this manual, 
with the following additions: The section on Purpose should 
be as extensive as possible, with emphasis on the areas of 
applicability of the program. If the program is fully 

documented elsewhere (e.g., MAC and/or CC memo), a full 
rafarance should be given. Examples of usage are extremely 
desirable. Second, information as to the directory and 
niffla (s) of the f ile (s) involved must be given, along with 
the names (and phone numbers) of at least two users, other 
than the author, who have used the program and who recommend 
its inclusion in the Public File. After favorable 

evaluation, the implementation considerations below apply, 
and tha massage of the day and the next S€t of revisions to 
the manual will herald the new arrival. 

IfffiiSJSIltaticn 

Ona of the system programmers will LINK to the file 
containing the new Public program from his (Mim6) common 
fila 4. The author must, of course, have PEBMlTed the file 
to M1U16 ♦. The system programmer, in turn, will PERMIT the 
link to all users. The mode of the link (the antry in the 
Public File) will normally be Read-only and Protected (RP) 
unlass the author specifically requests a different node. 

A rastriction on authors is implied ty the fact that, at 
present, links may only be nested to a maximum depth of 2. 
(This limitation was made to allow efficient searching and 
to keep the file conttcl system fy^om executing an indefinite 
loop.) "Public" files, however, require two links to be 
raa::had and therefore, may not link further themselves. 

Tha author's file directory is the only one which is charged 
for the records occupied by the file. There is no "free 
riia" for files "in" the Public File (as they are not 
actually there), while at the same time there need be only 
oua copy of a file in the entire file system. 

Ij.§j3g_gj--?.\i?^2^^ Programs 

Onca tha Public program has teen "hooked up" as described 
above any user may then LINK to tha file entry in the Public 
Fila (Miai5 CMFLCU) after which he may use the file it 
references as if it were one of his own files. 



CTSS FRCGBAMMER'3 GUIDE Section AD, 4 12/69 U 



Throu'jh the LINK facility, it is, of course, not necessary 
to COPY into one's own files. Further, it is requested that 
usars in general Qot copy files listed in the Public File. 

copies of files (thus conserving disk space) and to allow 
modifications made by the author to be:;ome imnediately 
available to users of the file. Modifications are reflected 
immediately because the linkage infornation is kept 
::ompl3taly in symbolic form. The chain of links is searched 
each time the file is opened or is referenced with the 
FSTATE supervisor entry. 



(END) 



CTSS PH0GRA.!!!*E5 • S GUIDE S«^Cti on AD. 5 12/69 1 

lilSJtii ication 
Time-acccunting files 
Purpose 

Th3 tima -accounting files keep all crucial user information 
sach as password, time allotments, party group numbers, etc. 
Thase filas are read and written by the commands LOGIN and 
LOGOUT and they can be updated by a few persons with special 
r2striction codes. 

P?.l.i.!li.tions 

Each person who is permitted to use the time sharing system 
is assigned a unique Iioarammer number (4 digits). 
Depending on the number of jobs he undertakes, he will also 
ha assigned one or moce problem numbers (1 alpha and 3 or 1 
numeric characters). Groups of people working on the same 
problam may be assigned the same problem number. When a 

user logs in, he types his problem number and last name. 
Tha combination of problem number and last six characters of 
the last name is neither unique nor secret. A six character 
secret password is therefore requested by LCGIN so that a 
check can be made of the accounting files to see if such a 
uriiqua rrombination exists. The unique combination defines a 
single user and a single file directory, with its associated 
tima and space allotments, etc. An administrator allots a 
certain acoount of computer time each month and a ^uota of 
secondary storage space to each user. In addition, each 

user is placed in a ^arty arcu£. Each party group contains 
some number of users and some different number of slots or 
lines which give access to the computer (see section 
AH. 1.01). Each user is also assigned to a unit g.rou£, which 
specifies the consoles the user may or may not use. 

Thare are five time-accounting files: 

UACCNT IIMACC 

TIM USD IIMACC 

FKTYGf TIMACC 

GHPUm IIMACC 

XSSFIL TIMACC 

ail of which are kept in the system files. 



CTSS PROGRAHMEa'S GLIDE Saction AD. 5 12/69 2 

y^CCNT TIMACC 

Th3 fila UACCNT contains identifying information fcr each 
uset » LOGIN searches UACCNI for the user's problera number, 
name, and password; this combination must be found before 
the person can be logged in. 

F2rmat_of_jJACCNT_lIMACC 

Three kinds of entries are fcund: 

1. Group header entry 

wd 1 GRPXX 
2-28 blank 

This entry precedes an administrative group block, 
composed of one or more £roblem number blocks. 

2. Pr cbl em -n umber header entry 

wd 1 ♦ 

wd 2 probno, normalized, right- justified 

3-28 blank 

This entry heads a problem-number block, 
consisting of one or more user entries for this 
problem number, (A normalized problem number is 
of the form LDDDD.) 

3. User entry 

2 card images: 

Wordi wcrd2 ... 

1) NAME EFOG PARTY SFBY U FD UNIT RCODE FLAGS PASS 

2) DFUK DISK TAPE Tl T2 T3 TU T5 

FLAGS and UNIT have blank right 
HCODE has leading zeroes 
NAME is left justified 



EABTY is party line group number 
STBY allow standby if non-zero 
UFE user's home file directory 

UNIT is unit group 
RCCDE has leading zeroes 
FLAGS are binary indicators: 

001 out of funds 

002 account expired 



CTSS FRCGRAMMER'S GUIDE Section AD. 5 12/69 



DRUM, DISK, etc. are quotas 
T's ate in minutes 



This entry corresponds to one authorized user or 
one camiBon file. Ihe following conventicns are 
observed: 

a. 28 word entry 

b. each item in one word only 

c. SIBY always "S« 

d. items right- justified except: 

NAME left-justified 
FLAGS one blank on right 
UNIT one blank on right 

e. BCODE has leading zeroes 

f. unused fields must be blank 

A special entry type is distinguished, the Jslu^a© 
user entry. This entry follows a noriEal user 
entry for a user authorized to use the ESL display 
scope. It is identicral to the preceding entry 
except in the following respects. The name has at 
least one asterisk {♦) on the right, and is filled 
with asterisks to make 6 characters. For example: 

SMITH SMIIH*, 
COE COE***, 

LIPSKI LIPSK*. 

The party group is always "20" and the unit group 
always "2". 

Entries for common files have only PROG, NAME and 
record guotas; name and proyrammer nuiauers are 
both CMFLXX. 

Sort of UACCNT riHACC: 

major key: group 

order is: 1, 2, 5, 3, U, 6, 7, 8, ... 

intermediate: problem number 

numeric order 
minor : prDgraaaer number 

numeric order , common files last. 



CXSS PROGRAMMER'S SLIDE 



Section AD. 5 



12/69 4 



IIi?USD TIMACC 

The fil3 TIMUSD cantains the following inforiBation fcr each 

TUn lime used for each shift, 

DATE, IIME Date and time of last logout, 

UNIT Console IC at last logout, 

TL l3tal time logged in since first of month, 

LDGIN reads the IIMUSD file each time someone logs in. 
LOGOUT updates the time used information and re-writes that 
portion of the file containing information on the user 
logging out. If the user was not previously in the TIMUSD 
file, a new entry is appended to the end of the file. 



Format of IIMUSD TIMACC 





2 


card images 




wordi 


word2 ,,, 


1) 


PROB 


FROG NAME 


2) 


DATE 


TIME UNIT 



T1 T2 T3 TU T5 CTU 



DATE 

TIME 
UNIT 

11-5 

CTU 



Last logout 



BMDDYY 
RHMM.T 
20000. 800273 etc. 



Time used, shifts 1-5, in seconds 
Console time used, in minutes 



PRTYGP TIMACC 

Tha file PRTYGP contains the party group information and the 
maximum number of users. The information contained is 

copied into the supervisor at system initialization time; 
the tables thus generated are later examined by LOGIN. 
Rafar to section AH. 1.01 for details about party groups. 



I oiMl_ of_£ RT Y GP_T IM A CC 



1) 



wcrdi word2 
MXUSHS 



rpq<; FRrnRAMMFR'S RJITDE Section AD-5 12/69 5 



2)...n) GRP HXGaP 



MXUSBS Maximum number of users permitted on CTSS 

GBP Party group number 

MXGBF Maximum primary lines for group 

All items ace right-adjusted in 6-character fields. 



GRPUNI TIM&CC 

The file GHPUNI defines groups of consoles the user may or 
may not be allowed to use. 

format of GflPUNI TIMACC 



Fixed field card images; one set for each unit 
group: 

word 1 word2 ... 

1) UGN NUH£ 
2) FLAG UNITID UNITID 

UGN Unit group number 

NUMB 14* number of cards following 

FLAG Zero or blank indicates permitted consoles, 

otherwise indicated forbidden consoles. 
UNITID Console identification 



The file TSSFIL defines those user file directories which 
ara to be considered as 'public*, and are to be made 
accessible via the supervisor entry TSSFIL. The information 
contained is copied into the supervisor at system 
initialization time. 

ForeJlt of ISSFI L TI MACC 

Fixed field card images; one card per directory: 

wordi word2 

PROEN PRCGN 



CTSS PROGRAMMER'S SCIDE 



Section AD. 5 



12/69 6 



PROBN Problem number of this directory 
PPCr.N Progcammer number of this directory 
CMFLOI) 



(e.g. 



Both are right adjusted 



(END) 



r cnni3 hmmvo^ < nVTVH <^i^ni' ^ nr\ AR.l 12/69 1 



liSfitif ication 

Bulk input and output 

Pur£osa 

Since the ccnscle is a relatively slow input/output device, 
it is necessary and desirable to have a means of entering 
programs and data into the disk files frcit card decks and 
conversely tc be able to output disk files onto cards or the 
high speed printer. Files may be punched on cards in such a 
format that they may later be reentered into the system to 
duplicate exactly the original file. In this way, cards may 
serve as a pernanent, inexpensive back-up. There exists a 
background program known as the "Disk Editor" to control 
these bulk input/output tasks. 

Restrictions 

Files of PRIVATE mode may in no way be output. Files of 

PRIVATE cr EFCTECTiiD mode may in no way te deleted by the 
Disk Editor; therefore, existing PRIVATE or efiOTECTED files 
ot tha same name as new files may not be replaced by INPUT. 
None of the disk editor requests will alter (delete or 
input) a file "through a link". 

Usa^e 

A Disk Editor program is run several times a day by the 
operations staff. Request cards to the Disk Editor may be 
submitted to the dispatcher by the user, or the RQUEST 
command (AH. 6. 06) may be used to create a card image file 
called OUTPUT RQUESI, which will automatically be processed 
by tha Disk Editor. (Each line within the OUTPUT RQUEST 
file is the equivalent of a control card and may, therefore, 
spacify any of the following requests except^ INPUT. The 
format of each line is the same as a control card except 
that FRCB ERCG nust nat be specified. See Method, below.) 
Only the first 72 columns of a request card will be read by 
tha Disk Editor. 

The control cards for the Disk Editor are of the format: 

XX PROS PROG NAME1 NAME2 OP ... NAtEln NAME2n 

The fields are separated by cne or more blanks, or by a 
comma, or by a comma and one or more blanks. 

XX is the type of I/O operation desired. (See 
below. ) 

PHOa is the user's problem number- (It must not be 
specified in an OUTPUT RQUEST file.) 



CTSS PROGRAMMER'S GLIDE Section AE.l 12/69 2 



£RCG is the user's programmer number. (It iiust not 
be specified in an OUTPUT RCUEST file,) If a 
ccmmon file is specified, PROG is of the form 

CMFLOn. 

NAME1 NAME2 is the file name. All requests except 
INPUr allow more than one file name per card 
with the restriction that the file name must 
be complete on one card, i.e., NAHB2 may not 
be on a continuation card. 

OP specifies an option (accepted by particular 
requests) . 

XX = »C» Continuation card 

XX='INPUT* This card must precede a card deck to be input 
to the disk as a single file, MAHEl !l&nE2. 
The deck may be in hollerith or column binary 
format. (The Cisk Editor employs 28-wcrd card 
images for column binary.) The last card of 
the deck must have •*£€?*' teginning in column 
8. "Flip cards" may be included in the deck, 
between the INPUT card and the first card to 
be input. Only one file name may appear on 
the control card and CE may specify the 
desired mode, in octal, for the file. If OP 
is not specified, a permanent file will be 
created. If a PRIVATE or PROTECTED file of 
the same name already exists, the deck will 
not be input. Decks will not be input 
"through links". Any errors discovered within 
the deck will cause the entire deck not to be 
input. The authorship of the file created is 
the programmer number of the directory into 
which the file is being placed. If this 
directory is a common file, the authorship 
will be zero unless an additional option 
following the mode is used to specify the 
author. For example, the following card could 
be used to input a file into M1416 CMFL03 in 
PROTECTED/READ-ONLY mode with '3812' as the 
author: 

INPUT M1U16 CMFL03 TAPE FAP 10U 3812 

XX='PRINT' The BCD file NAME1 NAME2 is printed off-line. 
If the file is not line marked, a blank word 
is inserted at the beginning of the line to 
insure single spacing and the first 8U 
characters of the record are printed. If the 
file is line-marked, the first character is 
the carriage control character and the rest of 
the line, up to 131 characters, is printed. 



If the file is line-marked and the secondary 
name is FAP or MAD, the file will be 
affectively XPANDed to 80 columns for printing 
with tabs replaced by the appropriate number 
of blanks and null characters deleted. A 

blank word will be inserted in front of each 
line t3 insure single spacing. Seguence 

nunbers will be inserted in columns 75-80. 
The file itself remains unchanged. 

If the secondary name is other than FAP or 
MAD, the file will te XPANDed to 132 

characters by inserting sufficient blanks so 
that tab stops come out at positions 11, 21, 
31, (+10) ..,, 121, Also, if the secondary 
name is ALGOL, LISP, or LSPOUT, a blank 
character will be inserted in front of each 
line to insure single spacing. However, an 

ALGOL file will be XPAMDed to 132 characters 
by interpreting tabs for columns 11, 16, 
(♦5) - . . , 66. 

XX=«SSPPNT' The ECE file N AM E 1 NAHE2 is printed with a 
leading blank en each line to insure single 
space printing. Line numbered files are 

always printed single spaced. 

XX='DPUMCH« The BCD file NABE1 NAnE2 is punched off-line. 
If the tile is line-marked, just the first 80 
characters per line of data will be punched. 
Line-marked files will be XIAMDei in the same 
way as described under PRINT. 

XX='BPUKCH' The binary card image file (28-word card 
images) NAME1 NAME2 will be punched off-line. 
The 7-9 punch and checksums should already be 
included in the card image file. 

XX = '7PUNCH' The file NAMEl NAME2 (of any format) will be 
punched off-line in a special card format 
which Bay be reloaded by the Disk Editor to 
reproduce the file exactly. The file is not 
deleted from the user's directory. 

XX='FLCr« The file NAMEl NAME2 will te placed on the 
plot output tape to be processed on the 
CalComp plotter, (see APM-I) 

XX=«DELETE' The file NAMEl NAME2 will fce deleted from the 
current file directory, PRIVATE or PROTECTED 
files may not be deleted. Deletion "through a 
link" will not occur. 



;TSS FFCGRAMMER'S guide section AE.1 12/69 4 



X)( = 'PRNDEi.', 'SSPRDL', 'DPUDEL', 'BEUDEL', 'TPUCEL', 
' PLODEL' : 

The file(s) will be PRINTed, SSPRNTed, 
DPLNCHed, BPUNCHed, 7PUNCHei, or PLOTed, 
respectively, and then the aiode will be 
changed to temporary. (PRIVATE or PROTECTED 
files will not be changed to temporary, nor 
will files be changed "through a link".) The 
next time the file is read or the user logs 

other request for the same file following a 
"DEL" request will cause the file to be 
deleted . 

Method 

The Disk Editor is a background job which is run several 
times a day by the operaticns staff. The users' file 

directories are searched for OUTPUT RQUEST files. When such 
a file is fcund, the editor ATTACHes to the user's file 
diractory and processes the requests found in OUTPUT BQDESI. 
Because the editor "knows" who the user is, PROB PROG need 
not b3 specified in the OUTPUT RQUEST file. Due to the file 
system locks, the user will not fce able to edit the OUTPUT 
RQUEST file while the Disk Editor is processing it. The 

OUTPUT RCUEST file will fce changed to temporary mode by the 
Disk Editor after it is processed. After all OUTPUT RQU ESTs 
have bean processed, the editor may read cards from the 
background input tape. As a result of the requests, the 
alitor may create three output tapes, namely punch tape, 
ptint tape and carry tape. These are then the 

responsibility of the operations staff. 



ITyCO 



7PUN-H Card Format 



The 7PUNCH card format is peculiar to the CTSS system at 

M.I.T., so that it, perhaps, deserves description. The 

7PUNCH cards are column binary cards which have punches in 
ro ws 1 2- 1 1~ Q~ 7- 9 o t col umn one . 

Word one in octal = 7WH5WWTSSSSS 

Word two = full word logical checksum of all words on the 
card except the checksum itself (dees not 
include coluains 73-80), 

Bamaining words are data words. 

wwww is the word-count of the number of data words 
tc be taken from the card. If wwww .LE. 

(26) 8, there are wwww words actually on the 
card (beginning with column 7). If wwww .G . 
(26)8, there is only one data word on the card 
(columns 7,8,9) and it is tc be repeated in 
core wwww times. 

sssss is a binary sequence number baginning with 
zero . 

T is zero, except on the last card where it is a 
one. 



(END) 



v^i-oo r nuvjn tt nnu n - J -jut-ifL. ^o^<.jlv><i 



I ^en t i f ica t i o n 

DAEMON: Disk Dump and Reload 
M. J. Bailey 

Puc£Ose 

For ttia purpose o£ user's file retrieval and catastrophe 
reloading of the disk, the contents of the disk must be 
written onto tape at some specified intervals. With the 

former file system, the entire content of the disk was 
written onto two sets of tapes at least once each day. 

With the new file system a new approach is being taken to 
the problen of back-up tapes, A program called the DAEMON 
runs as a console- less foreground user continuously, except 
whan a complete relsad is being performed. The operation of 
the DAEMON will be controlled by the operator from the 
consola keys under the guidance of on-line printer messages. 
The DAEMON can perform three separate functions. It may be 
instructed to perform a complete dump, at which time the 
entire contents of the disk will ba written onto tape. This 
will normally be done once a week. The complete dump tapes 
will ba divided into two sections, one for the systen files 
(SDT) and another for the users' files (UDT). The DAEMON 

will ba instructed to do incremental dumping as its normal 
continuous operation. The incremental dumping will consist 
of writing onto tapes (Nfl) only those files which were 
modified or created since the last incremental dump tape was 
closed. The files will normally be written onto tape only 
after a user logs cut. The volume of output to the 

incremental dump tapes should be considerably less than that 
of the complete dump tape. The third function of the DAEMON 
is to reload the system. An independent program will be 
usai to reload the system files (including the DAEMON 
program) from the SDl tapes. As soon as the system files 
ara loaded, the DAEMON will be called to complete the 
reloading from the remaining user dump tape (OCT) and 
incremantal dump tapes (NFT), This final reloading will 
also be performed during time- sharing. 

Retrieval of specific files can be requested by specifying 
tha date of the last complete dump tape or specifying the 
dste and time of the desired version from an incremental 
dump tape. Details of retrieval will be published at a 
latar time. 



(END) 






Ra trisval 

Files which have been lest (e.g., i.nadvertent ly deleted) 
from tha disk may usually be retrieved from history tapes. 
Unisr the DAEMON, there are two sorts"*o£ history tape: the 
Complete Dump Tape (CDl) , which includes both System and 
Usar Dump Tapes (S DT , UCT); and the New File Tape (NFT) , or 
the incremental dump tape. CDTs are crreated weekly by the 
DAEMON at the request of the Operations Staff. These tapes 
represent a dumpiny cf the entire disk at a given point in 
tima ; and, in particular, of a user's entire directory. 
Alternate (i.e. every two weeks) CDTs are saved for one 
yaar. NFTs, on the other hand, represent a dumping of files 
which have been altered or created (not merely used) during 
users* console sessions. That is, when a user lo^s cut, the 
DAEMON will deteraine whether any "new" files have appeared 
and will dump any such files it finds. (This process is 

usually performed within an hour after a given user logs 
out; tharafore, barring unforseen circumstances, back-up is 
afforded to any user who does not log out, log in very 
shortly thereafter, and lose a file created during the last 
session.) NFTs are currently saved for only six weeks, due 
to tapa library limitations. 

pum£_Ma£S 

When the DAEMON performs dumping, it also produces listings 
of tha files dumpad. These "dump maps" contain time dumped, 
problem number/programmer number, file names, and other 
information. Binders containing print-outs of the listings 
are kept in the Dispatching Areas. The dump maps also 

specify which set of reels (within tha dumping period) is 
involved in the right margin of the listing of files on the 
reels. For NFls, the time of dumping is sufficient; 
howavar, note that the NET dump maps are ordered by time of 
dumping only, and if a file was altered during several 
different console sessions the dump map must be searched 
carafully to find not merely an instance of a file's being 
dumped, tut the instance of the file's being dumped which is 
specifically desired. 

Sco£e_of_ Requests 

If several files are to be retrieved from a CDT, it is 
possible that a request for "entire directory" retrieval 
would be a good idea. The retrieval process will not 
disturb existing files (exception: secondary mode files 
which "axist" only as U.P.D. entrias, but have been removed 
by tha storage collection mechanism) , so that only missing 
files will be replaced. Thi£ approach is desirable in that 



CTSS PRCGBABMER'3 3UIEE Section AE.2-01 12/69 2 

requests for too many individual files can over-fill the 
retrieve conntand's internal tables and necessitate a second 
scan of the tape. 

Both NFT and CDT retrievals will accept an asterisk (♦) as 

the first or second name of a file; the result «ill be 

ratriaval of all files possessing the specified second or 
first narae, respectively. 

" H^ m i 1 1 i n a_R e a a e s ts 

"Retrieval Request Forms" are available in the Dispatching 

Araa. They are to be filled out, time stamped, and placed 

in the appropriate tray. The retrieval will ba run by the 
Oparations Staff as soon as possible. 

n3ssag.es 

Progress (or failure) reports on retrievals will be placed 
in the requestor *s directory as files named 'URGENT MAIL' or 
•URGENT POST'. They are headed with a row of asterisks, the 
words 'MAIL FROM DAEMON RETRIEVE' , and the date the 
retrieval was run. 



(END) 






Restrictions for Background systems 

Purpose 

Any progranniing systen or program under such a system that 
is to ba run as back'^roand under CTSS must observe certain 
conventions or restrictions. These conventions arise due to 
two main system rejuicements : that the tackground program 
be interrupt ible and that changes of machine state (such as 
anablsoent for traps) are a CTSS supervisor function illegal 
for the background tc perform. The main area of a program 
affactad is its input and output which must be timing 
insensitive. (Of course, a background system may — and 
most probably will — place restrictions of its own on 
programs under its central. The MIT version of the Fortran 
Monitor System (FM3) is an interesting example of a 
background system, and is freguently used; its internal 
r3Strictions can be found through CC-255, a Computation 
Center Merooranduic.) 

ES§trictions 

Change of state: 

All changes of state are trapped by the protection mode 
hardware but certain ones are processed by the 
supervisor and allowed, such as EFTM (enter 
floating-point mode). 

The following instructions are not allowed and, if 
used, will cause an on-line diagnostic: 

ECTW LPI TIB 

ESBT LRI 

ESTM SEA 

ETM SEB 

The instruction ENB (enable) is also not allowed, but 
if used it will be treated by CTSS (which processes the 
trap it causes) an an effective NCE (no operation) 
i.e., it will not be executed and control will be 
returned tc the next instruction. 

I/O timing : 

Input and Output must be programmed so that they are 
not timing dependent; thus the LCHX (load channel) 
instruction is prohibited. An RCHX (reset and load 
channel) instruction, if given, must immediately follow 
the select instruction. An exception is made for the 
on-line printer and punch where up to 3 SPR's, SPU's 
and/or NCE's can come between the Select and RCHX 
instructions. If an RCHX is given that does not comply 
with these conventions, it will still be executed but 
its execution may turn en the I/O check light if it was 



CTSS EBCGRAMMEB'S GUIDE Section AF.1 12/69 2 

not given "in time". 

I/O flag: 

All I/O coKiBands (including TCH) must have a "1" in bit 
20 (tag of 1 to FAP) to indicate that the information 
is to be transferred to or from B core. A diagnostic 
will be given if this condition is net met. 

The FAP assemblec accepts the pseduo-op, BCOBE, which 

autcmatically incl udes' this bit 20 in all I/O coBmands 

such as lOCD, lOBl, TCH, etc., and flags any illegal 
instructions used. 

I/O units: , • , wi * 

Only the following I/O units are available for 

background systems: 

a. card reader, card punch, and printer 

b. tape units A1-A5, AlO, B1-B5, BIO 

c. A7, the chronolog clock 

Referencing of other units will cause a 
diagnostic, 

PcograiB stop: 

Any intentional background systeit stop should be 

effected by an HER instruction rather than an HPR . The 

instruction counter is set differently on the two 

instructions and due to this difference the HPR if 

interrupted (e.g. by data channel trap) does does not 
causa a genuine program stop. Example: 

A HTR Instruction counter set to A; 

resumption after interrupt at A. 
B HPB Instruction counter set to B+1. 

resumption after interrupt at B+1. 

Any FAP program using the BCORE pseudo-op will 
automatically have all the HPR's flagged. 

Console keys: . . 

Operating procedures have been modified to limit 
operator intervention or interaction with a background 
system from the 7094 control console in such a way that 
no foreground user or the CTSS supervisor is affected. 
The address portion of the console keys (or "Panel 
Input Switches") is used by the CTSS supervisor for 
this function and therefore cannot be used by a 
background system. Operators can use the keys to 
simulate the following functions: 

a. initiating "a standard error" procedure. 
(Octal key code 1) 



<:ae'* inn hV 1 19/fiQ 



b. depressing the "Load Cards" button 

(Octal Key code 2) 

c. depressing the "Clear 5 Load Cards" buttons, 

(Octal key code 3) 

(The octal key codes are introduced by placing 
appropriate keys down in positions 30-35, and are 
called to the attention of' the CTSS supervisor by 
placing key 21 down) . 

A "standard error" procedure is defined as: storing 
the instruction counter in a prearranged location and 
transferring control to another prearranged location 
(normally a transfer to a post-morteit routine or to the 
background system itself). The background system 
specifies these two locations to the CTSS supervisor by 
the following call: 

ISX DEFERR,U 

PZE ERHILC,, EHRTR& 

whara DEFEHB contains: TIA =HDEFERB. EBBILC is the 
location where the instruction counter will be stored 
cind ERHTSA is tha location to which crontrol will be 
transferred. The point of this procedure is that it 
allows the operator to take effective action in the 
3vant of some sort of "hang-up" in the background 
systen, placing that system back into control if a 
program running under it "runs away" from it. 

Independent operation: 

If the background system is to be designed to operate 

independently af the CTSS supervisor, then the 

background system must be able to verify its mode of 

operation. A means of determining this so that a 

switch can be set is to execute the following 

instructions: 

Tsx rEsrss,4 

(1,4) return if running 

independently 
(2, U) return if running 

with CTSS 

TESTSS riA L 

L TRA 1,4 

If running under the CTSS supervisor, the TIA is 
interpreted as a regular supervisor call with a 2,4 
return. If running independently, there is no "other 
core" to trap into and the TIA L is executed as a TRA 
L; thus the 1,1 return is the net result. 



CTSS EBCGRAMMtR'S GUIDE Section AF, 1 12/69 



Timars : 

The subroutines for determining the time operate 
properly whether the background system is running 
independently or not. Ihe FMS subprogram GETTn can be 
used to read the date and time of day from the 
chronolcg clock. The FMS subprogram TIMR can be used 
to determine elapsed time from the interval timer 
clock, although when running with CTSS the operation of 
the interval timer clock is simulated and incrementing 
takes place only every 200 ms. (as opposed to every 
1/60 th of a second when running independently). 

The simulated cell 5 interval timer can also be used as 
an alarm clock; this alarm clock is always enabled. 



(END) 



i-rsi» tHUAjKflnnjEn-3 uu ti/i 



•J ^ \« C X V^ If 



10 xfcQ 



SupervisDC Entries Reference List 



BiS!ia£2iifi4-i.I§t^S.-^fi-ii 



AF, 1 


CHECK 


AF. 1 


DEFERR 


AF. 1 


BSTIME 


AF. 1 


SELECI 


AF. 1 


TBS 1,4 



check tape I/D 

define error nrocedure 

reset UTIME 

does nothing 

does TRA 2, «4 



£.£ i vi 1 3 le d _C o m m an d s_On 1 jr 



none 


6. 36AA 


♦ 


none 


6.36ZZ 


♦ 


none 


636CHK 


♦ 


none 


CLOCIN 




none 


ENTLIN 




none 


FINDSB 




none 


HNGOSR 




none 


KILL 




none 


NOTIW 




none 


PRINT 




none 


PUNCH 




none 


RSSWB 




none 


SCHEDL 




none 


VACUUM 





Spagial Priv il ec[e 



AG. 7. CI 
AH. 2. 06 



SEILOC 
DSCOPE 



start tape write 

finish tape write 

check tape I/D 

read chronolo;j 

enter input line for user 

find standby user to kill 

hang up phone after LOGOUT 

kill user 

set user MOTIME code 

on-line print 

on-line punch 

reset user write buffer 

call scheduler 

free all adopted consoles 



modify supervisor 
ESL scope 



All Users 



AG. 6.05 
AG. 6. 05 
AG. 8.03 
AG. 6. 01 
AG. 6. 01 
AG. 4. 06 
AG. 6. 01 
AG. 7. 01 
AG.e,C3 
AG . 6 . C 3 
AG. 8. 04 
AG. 6.01 
AG. 12-01 
AG. 7. 01 
AG. 6. 06 
AG. 8. 05 
AG. 8. 05 
AG. 7-07 



(EFTM) 
(LFrn) 
CHNCOK 
DEAD 
DORMNT 
FEBRTN 
FNBTN 
GETABY 
GEICLC 
GETCLS 
GET COM 
GETILC 
GETIME 
GETLOC 
GETflEM 
GEIOPT 
GETSYS 
GETWRD 



enter floating -trap mode 

leave floating- trap mode 

go to next command 

program exit, dead status 

program exit, dorman status 

set file-error return 

go dormant, don't change ILC 

examine tlock of supervisor 

get command location counter 

get command list 

get command parameter 

gat ILC at last call to CORMNT 

get date, time 

examine supervisor 

get memory bound 

get option status 

get subsystem status 

get A-core variable 



CTSS EBCGRAMMHR'5 GUIDE 



Section AG.G 



12/69 2 



AG. 12.0 1 
AG. 7. 09 
AG.fc.C5 

, ^ r^ ^\ 1 

Atj. o. u I 
AG.e.05 
AG. 8. 03 
AG. 8.03 
AG. 6. 06 
AG.e.05 
AG. 8. 05 
AG. 7. 07 
AG. 6. 08 
AG. 3. 03 
AG. 12.03 
AG. 3. 03 
AG. 7. 05 
AG. 1.0 1 
AG. 1.01 



GTEYXM 

IS IN 

LOOP -I 

NEXCOK 

RSOPT 

SETCLC 

SEICLS 

SET MEM 

SEIOPT 

SETSYS 

SETHRD 

TILOCK 

TSSFIL 

UPCLOC 

USBFIL 

WHOAMI 

WBFLX 

WRFLXA 



get file system date and time 
get line no. of logged-in user 

S load option bits 

load new co is stand 

S turn off option bits 

set comniand location counter 
set command list 
set memory bound 

S turn on option bits 

S set subsystem status 

set A-core variable 
set file interlock return 
attach to public directory 
update simulated interval timer 
return from TSSFIL 

get user identification parameters 
write on console with c.r. 
write on cronsole 



Anione_But_BackaiouM (FIB may use) 



none 

AG. 12.03 
AG. 12.03 
AG. 3. 03 
AG. 1.0U 
AG. 6. 03 
AG. 7. 02 
AG . 1 . 1 1 
AG. 12.04 
AG. 1.C1 
AG. 6. 03 
AG. 1.02 
AG. 6. 3 
AG. 1.02 
AG. 1. 11 
AG. 1.02 
none 



CHEALL 

CLOCOF 

CLOCON 

COMFIL 

FORBID 

GETBRK 

GETCF 

KILNBK 

BDYIIM 

RSSRB 

S AVBRK 

SEIBCD 

SETBRK 

SE IF OL 

SETMBK 

SETNCV 

WSCOPE 



does nothing 

turn off simulated interval timer 

turn on simulated interval timer 

attach to common file 

forbid inter-program messages 

get ILC at last interrupt 

get common file last attached to 

kill no-fcreak mode 

type ready message 

reset accumulated unread input 

reset console interrupt handler 

put terminal in 6-bit mode 

set handler location for interrupt 

put terminal in 12-bit made 

do not wait for "break" char (c.r.) 

turn off typewriter code conversion 

send graphical characters to ARCS 



LSEearoujnd^Cnli (FIB may not use) 



AG. 


1 « 


,04 


ALLOW 


AG. 




.05 


AIICON 


AG. 


1. 


,08 


GETBLP 


AG. 




.01 


RDFLXA 


AG. 




.05 


RDLINA 


AG. 


1 4 


.04 


RDMESS 


AG. 




.05 


REDLIN 


AG. 


1 4 


.05 


RELEAS 


AG. 




.05 


SEI12 


AG. 




.05 


SET6 


AG. 


.7' 


.08 


SEIBLP 


AG. 


1, 


.05 


SLAVE 



allow inter- program message 

attach remote console 

get "blip" 

read line from terminal 

read attached console 

read inter-program nessage 

read attached console 

release attached console 

set mode of attached console 

set mode of attached console 

set "blip" 

attach remote console as a slave 



v^xoo rnv»onnncioi\ 



U UX L/£f 



oci^ ti Ull 



■1 ^ * £ t\ 



AG. 6. 02 
AG. 1.C5 
AG. 1.05 
AG. 6. 02 
none 
AG. 1.04 

Fila; .System 

AG. 7. 03 
AG. 7. 03 
AG. 7. 04 
AG. 2, 08 
AG. 3.0 7 
AG.2.08 
AG. 3. 07 
AG. 7. 03 
AG.2.08 
AG. 3. 07 
AG.2.08 
AG. 4. 06 
AG. 5. 05 
AG. 7. 03 
AG. 5. 05 
AG. 7. 3 
AG.2.08 
AG.2.08 
AG.2.08 
AG. 3. 06 
AG. 7. 03 
AG. 7. 03 
AG.2.08 
AG. 3. 07 
AG. 5. 5 
AG.2.08 
AG. 5. 05 
AG. 7. 03 
AG. 3. 07 
AG. 7. 03 
AG. 5. 05 
AG.2.08 
AG. 2. 08 



SLEEP 

SNDLIN 

SNCLNA 

WAIT 

WBHTGH 

WRMESS 



ALLOT 

ATTACH 

ATT NAM 

BUFFER 

CHFILE 

CLOSE 

DELFIL 

DELMFD 

FCHECK 

FSTATE 

FWAIT 

lOCIAG 

LABEL 

LINK 

MODNl 

MOVFIL 

OPEN 

BDFILE 

BDHAII 

RESETF 

RSFILE 

SEIFIL 

SETPBI 

STOBGE 

TAPFIL 

TRFILE 

UttOUNT 

UNLINK 

UPDATE 

UPEMFD 

VERIFY 

WRFILE 

WRHAIT 






T 
T 



If- 



T 

* 
T 



go dormant, restart automatically 
send line to attached console 
send line to attached console 
wait for timer or input 
write high-speed lines 
write intar-program message 



set secondary storage allotment 

attach to other directory 

find directory attached to 

provide file system with buffer 

change mode, name of file 

close file 

delete fila 

delete MFD entry 

check on I/C completion 

get file status 

wait for I/C completion 

find out what went wrong 

label tape 

establish link 

ask for tape to be mounted 

move file directory entry 

open a file 

read file 

read file, wait until done 

reset all open files 

reset locked file 

set file status 

set priority 

get storage allotment and usage 

create tape entry in UFD 

truncate file 

ask for tape to be unmounted 

remove link 

update file directory 

add MFD entry 

verify tape label 

write file 

write file, wait until done 



* Denotes privilege required 

T Denotes tape call 

S Denotes subsystem- restric ted call 



(END) 



CTiJS PKOCiKflSncH '5 GUIDE 3autiun AG . 1 . "i "M/ij ^ 



I d en ti fie at ion 

Sanaral I/C without format specification 
RDFLXA, BDFLXB, RDFLX:, WRFLX, WBFLXA, BSSHB 

Purpose 

To read from or print on the console without format editing. 

Usac|e 

As supervisor or library entries: 

TSX RDFLXA, 4 optional (TIA =HBDFLXA) 

PaE LOC,,»n« or PTW LOC,,tl 

RDFLXA reads a line from the console and moves n 

words into core beginning at location LOG. On 
return, the AC will contain the value ic, the 
nuBber af (6-fcit) characters read; that is, in 
6-bit no^e, the break character is the kth 
character; and in 12- bit oode, the break 
character is the k/2 character. The word 

containing the break character and subsequent 
words are padded with blanks. If the break 
character is not received before the 
supervisor's input buffer is full, bit 21 of 
the AC will be 1 , indicating that another call 
to RBFLXA is required to continue reading the 
line. In this case, k will be a multiple of 
six. 

To type out in the current mode: 

TSX RRFLXA,** optional (TIA =HHRFLXA) 
P«E LOC,,*n» or PTW LCC,,S 

ISX HRFLX,U optional (TIA =HWRFLX) 

P2I LOC,,«n» or PTH L3C,,N 

To force 6-bit mode: 

TSX WRFLXA,i* or TSX HfiFLX,t 

MZE LOC,, 'n* 

To force 12-bit mode: 

TSX WRFLXA,4 or TSX HHFLX,4 

nO» LOC,,«n» 

WBFIXA will print n words beginning at location 

LOC (n.LE. m in 6-bit mode; n.Li5.28 in 12-bit 
mode) . It does not add a carriaje return at 
the end of the line and does not delete 



CTSS FPCGRAMMER'S GUIDE Section AG. 1.01 12/69 2 



trailing blanks. 
WBFLX will print through the last ncn-blank 

(^ {ja La (^ LC L ulLuin LUC u auLuo uc j x mtx nv^ au 

location LOG (n.LE.IU in 6-tit mode; n.LE. 28 
in 12-bit mode). Trailing blanks will be 

deleted and a carriage return inserted after 
the la£t non-blank character. 



As library subrcutines; 

flDFLX: 

rSX BEFLX,U 
P&E LOC, 'n* 

BDFLX will read a line from the console using 

RDFLXA. It will then strip the break 

character from the line, pad any remaining 
characters ap to n words with blanks, and move 
the n words into core beginning at location 
LOC. If n is less than the number of words 
read, the chara:;ters in excess will be lost 
(n .LE.1U) . 



A= RDFLXC. (LOCK) 

A= BDFLXC (LCC, K) 

or TSX RDFLXC, 4 



LOC is the beginning location of an array into 

which information is to be stored. If called 
by MAD or FORTBAN, information will be stored 
backwards from LOC, If called by FAP (i.e., 
P2E prefix) , information will be stored 
forward from LOC. The array LCC must be at 
least (k+5)/6 words long. A line of more than 
14 words may be read with one call. 

K contains the value k which is the number of 

6-bit characters to be read. 

A will contain a right adjusted integer equal 

to the number of 6-bit characters actually 
read. 

RDFLXB using RDFLXA, moves k characters including 

the break character into LOC. Remaining 



RDFLXB, BDFLXC: 






MAD: 


A= RDFLXB. 


, (LOC, K) 


FORTRAN: 


A= RDFLXB 


(LOCK) 


FAE: 


TSX 


BDFLX B, 4 




P«E 


LOC 




paE 


K 




STJ» 


A 



fyyCQ 

\^'x:3i3 rtujuKHniiDn-o auxut. — — - - — --- 



characters up to k are blank padded. 

HDFLXC is the same as RDFLXB except that k and A 

do not include the break character. 



X ^-^ tc-jc; I- L ^^ 1^ u, w&itv^^AVA • 

rSX RSSRB, a optional (TIA =HRSSRfl) 

PAR =0 

RSSRB will reset all input waiting for the user in 
the supervisor*s input buffers. 

The argument is unused at present, but should 
be specified as 0. Return is made to 2,4, 



(END) 



Ilan tif ication 

Set the conscle character mode switch. 
SETFOL, SETBCD, SEINCV 

P ujp pose 

To s-et the ccnscle character mode switch. 

ysag_e 

As supervisor or library entry: 

TSX SEIFUL,4 optional (TIA =HSETFUL) 

Sets the console character mode switch to 
"full" 12-l;it mode. 

TSX SEIBCD^U optional (TIA =HSETBCC) 

Restores the console character mode switch to 
the "nomal" 6-bit BCD mode. 

rSX SETNCV,4 optional (TIA =HSETBCV) 

Sets the console character eode switch to 
allow input to be transmitted to the user 
pcograa without code conversion. 

Upon return from any entry, the AC is zero if 
the previous setting was 6-bit mode, 1 if the 
previous setting was 12-bit mode, or 2 if the 
previous setting was no-convert mode. 

All three library entries may be called by HAD 
or Fortran programs. 

All input waiting in the supervisor's buffers is reset 
(lost) if any of these calls are made. 



(END) 



uxaa fHL»UKannr.K '3 \3ULUC. okut-auu au . i,uj stakj*: i 

I^S£tification 

Console output 

PRNTP, PRNTPA, PRNTPC 

Purpose 

To print a fenced message on the console with a routine 
which may be called by FOHTBAW anl HAD. 

ysa3.e 

As library subroutine: 
MAC: 

EXECUTE PRNTP. (MESS) 

• • • 

VECTOR VALUES M ESS=$hollerit h str ing$, 777777777777K 

FORTRAN: 

CALL PRMTP (nH hollerith string) 

PRNTP, the hollerith string up to the fence prints, 
on the user's console, 14 words per line. The 
string may be of any length. If the fence is 
(377777777777)8, there will ba no carriage 
return at the end of the nessage. The fence 
which Fortran automatically supplies is 
(777777777777) 8. 

PRNTPA, instead of PRNTP, inserts a carriage return 
every lUth word, with no carriage return at 
the end of the message. 

PRNTPC, instead of PRNTP, inserts no carriage returns 
at all. users must supply what they wish in 
order to control the printing. 



(EHO) 






3^4.antif icatign 

Intar-user communication 
WeilESS, BDMESS, ALLOW, FORBIE 

Purpose 

To provide the facility for users to cominunicate with each 
other directly, several routines have teen added to the 
suparvisor which allow the sending and receiving of messages 
by way of the console input tuffers. Privacy screens have 
been provided which "allow" or "forbid" the sending of 
massages by specified users. 



Method 



1) Short messages may be sent to another user's 
console input buffer. 

2) Selectively, short messages may be received 
in one*s own console input buffer froB other 
users. 

3) The console input buffer may be read. 



Usa^e 



To send a message: 

As supervisor entry: 

TSX WRBESS,4 (TIA =HtfRMESS) 

PZE =HPROBil 

PZB =HPH06N 

PZE LOC,,'n« 

PROBN is the problem number of the receiver (5 
character right adjusted with leading blank). 

EBOGN is the programmer number of the receiver (4 
digits right adjusted, leading blanks) . 

LOC is the beginning location of the message to be 
sent (forward) . 

n is the nuafcer of words in the message 

beginning at LOC. If n is larger than 12, a 
value cf 12 will be used. 

Upon return, if the AC is non-zero, it contains an error 
3oi3 which indicates that the call was unsuccessful. The 

following error codes have been assigned. 

1 - The specified receiver is not a current user 

of CTSS. (i.e. logged in). 

2 - The receiver's input buffers are full. 



CTSS fBCGRAMMER'S GUIDE 



Section AG.1 .04 



Page 



3 - The receiver has not given permission for the 
sender to send messages to his input buffer. 

If the AC is zero, the first xocd of the receiver's input 
buffer will then contain an octal 77 in character 1, and the 
Sander's problem number in characters 2-6. The second word 
will contain the sender's programmer number, right adjusted 



aa3 blank 

the 

ths 



padded* 



rhe n words of the message will begin m 
third word. If n is less than 12 the terminal words of 
1U word buffer will te blank padded. 



To read a message from the input buffer; 
As supervisor entry: 



RCHESS, 4 



rsx 

PZE LOC'n' 
ALPHA 0PM EMPTY 

Nornal return 



(TIA =HRDBESS) 



n words will be moved from the input buffer into 
locations beginning at LOC. 

If the user's input buffer is empty at the 
time of this call and ALPHA contains a zero, 
the user is placed in input wait status. If, 
however, ALPHA does not contain a zero, 
control returns to ALPHA. 

To be selective about who shall send messages to the user: 
AS supervisor entry: 



rsx 

PZE 

PZE 



ALLOW, 4 
sHPROBH 
= HPROGM 



(TIA 



=HALLOH) 



FBCBM 



is the problem number and PROGH is the 
prcgrasmer number of the programmer who may 
use WRMESS to send messages to the user's 
console input buffer. Each call tc ALLOW 

overrides all previous calls. 



on 



If PHOGN is zero, all programmers 
number PROEN may send messages. 
If PROBN is zero, programmer PHOGN may 
messages, whatever his problem number. 
If both PHOBH and PROGN are zero, 
programmer may send messages. 



problem 
send 



any 



r-T<;c DDnno&MMPDtc niiTnt? 



CQf~ -n nr% »n 1 nil 






To lock everyone out: 

As supervisor entry: 



rSX FORBID, a 



(TIA =HFOHBID) 



FOBBID prevents any programs from sending lines to 
the user's console inout buffer. 



(E8D) 






lis ntifi cation 

Slave rettote consoles 

ATTC0N,BELEAS,SNDLIN,3NDLNA, REDLIS,RDLINA,SLAVE,SET6,SET12 

Purgosa 

To allow multiple reBote consoles simultaneously to serve as 
I/O devices foe a single program. 

Definitions and Cop vent ions 

Th3 console at which a user logs in is his home console. 
Othar consoles associated with a user have bean attached by 
him, and they remain attached until he releases them. 

A console attached to one user nay not simultaneously be 
attached to any ether user. An attached console may not 
simultaneously be the home console of any user. 

An attached console which automatically transcribes into its 
output each character typed into the attach er's ho roe console 
ii^ an 10 slave. Similarly, an attached console which 
imitates the heme console's output is an OD slave. An 
attached console whose typed input appears as input at the 
horaa console is known as an II slave. 

Aij described in AC. 3, each console is permanently associated 
with a 6 -character console identification wor^. These 
consola I. D. »s are central to the present facilities. 

TO attach a console, dial into the computer, and when the 
ready message is typed, issue the command 

DIAL probn prog 

where 'probn prcg» is the user attaching the console. For 
datails, refer to section AH. 1.05. 

A quit signal issued from an attached console causes it to 
be detached; in addition, if the console remains inactive 
for two minutes after teing detached, it will be 
disconnected fron the conputer. 



CTSS PPCGRAMMKR'S GUIDE 



Section AG. 1.05 



12/69 



Usa^e 

To attach a console: 

As supetvisct entry: 



rsx 

PZE 



ATTCON, 4 
CONSOl 



(TIA 



=HATICON) 



CONSOL is the location containing the 6 character 
console identification of the console to be 
attached. 



Upon return, the hZ will be 
console is • 
attached to this 
and no attachment 



(HOME) , 



user 



26 ro if the 
attachable, 
. The AC will 
made, if the 



designated 
or already 
be non-zero 

designated 



console is attached to another, the home 
console of any user, or otherwise inaccessible. 



To release a console: 

As supervisor entry: 



TSX 

PZE 



RELBAS,4 
CONSOL 



(TIA 



=HBELEAS) 



Upon return, the AC will be zero if the designated 
console was attached (and therefore is now 
released) or was • (HOME)'. In all other cases 
the AC will be non-zero and no action taken. 



To send a line: 

As supervisor entry: 



ALEHA 



TSX 


SNDLIN,U 


PZE 


CONSOL 


PZE 


LOC,,«n» 


OPN 


FULL 



(TIA =HSNDLIN or =HSNCLNA) 



normal return 



The line to be sent to the designated console's output 
buffer is n words long and begins at location 
LOC. 

SNDLIN eliminates trailing blanks and adds the carriage 
return at the end of the line. 



SNDLNA does not eliminate blanks and does not add 
carriage return before sending the line. 



the 



CONSOL If CCNSOL is '(HOME)', the line is sent to the 
user's heme console output buffer. If the 

designated console is not attached to the user, 
return is to the normal return with the AC 
non -zero. 



CTS5? PROGRAMMER'S GUIDE 



Section AG. 1.05 



12/69 3 



ALPHA If the output buffers at the designated console 
are full and ALPHA is zero, the user is placed 
in OOrPUT WAIT status. If ALPHA does not 

contain zero, control is immediately returned to 
ALPHA. 

To read a line: 

AS supervisor entry: 



ALPHA 



ISX 
PZE 
PZE 
OPH 



BEDLIN, 4 
CONSOl 
LOG,, 'n* 
EMPTY 



(TIA 



=HB£DLIN) 



normal return 



REDLIN Mill move n words from the designated console's 
input buffer to core beginning at location LOC . 
If the move «as successful, the AC is zero. 

CONSOL If CONSOL is '(HOME)', the line will be moved 
from the home input buffers. If the designated 
console is not attached, no action is taken and 
the normal return is taken with the AC ncn-zero. 

ALPHA If the designated console's input buffers are 
empty, and ALPHA is zero, the program is put 
into INPUT WAIT status. If the buffers are 

empty and ALPHA is not zero, control is returned 
isnediately to ALPHA. 



Alternate form: 

As supervisor entry: 



ISX 


RCLINA, 4 


PZE 


CONSOL 


PZE 


LOC,, 'n* 


PZE 


EMPTY 


PZE 


EBROR 



or 



N 



(TIA =HaDLIHA) 
LOC,,N 



BLK 



PZE 



■n 



RDLINA will move n words from the input buffer to core 
storage beginning at LOC. The AC on return will 
contain a character count indicating the number 
of 6 -bit characters read, including the break 
character. If the line was incomplete (no break 
character), tit 21 will te on (4C000 bit in the 
address field) , and the character count will be 
a multiple of 6. (The character count returned 
is identical in format to that returned by 
BDFLXA. See section AG. 1,01). 



EMPTY Beturn will be made to location EMPTY if the 
input buffers do not contain a complete line. If 
EMPTY is 0, the program will be placed in 



CTSS PHOGHAWrtER'S GUIDE 



Section AG. 1.05 



12/69 U 



input-wait status. 
ERROa If CON SOL is not attachad, return is 
the A- 0. 



E6BGB. If ERROR ia 0, nori&al rsturn xt 



made to 

tm » A Q u^ VK 

MI(SVA€ 11.4. Wl^ 



To create a slave: 

As supervisor entry: 



rSX SLAVE-U 
PZE CONSOI 
PZE nODE 
normal return 



(TIA 



=HSLAVE) 



CONSOL 



If the designated console is attached, it is 
made a slave according to KCDE and normal return 
is made with AC zero. If it is not attached, no 
action is taken and the normal return is taken 
with non-zero AC. If CONSOL is MHOHB)', this 
call is ignored and AC is zero. 



MODE 



There are three distinct slave 
providing eight combinations 
console. The word at MODE is 
three pairs of letters. If any 
recognized, the console is 
accordingly. If WODE does 

recognizable pair, the console 



modes (11,00,10) 

for any single 

interpreted as 

of the pairs is 

made to slave 

not contain a 

is unslaved. 



To set the character laode: 
As supervisor entry: 



TSX 

PZE 



SET,U 
CONSOL 



(TIA =HSET6 or =HSET12) 



SET6 sets the designated console in 6- bit mode, 

SET 12 sets the designated console in 12-bit mode. They 

both reset the input buffer unless the console is 

already in the specified mode. 

If the designated console is '(HOME) ', the user's 
console is mode-set. If the designated console 
is not attached, return is made with non-zero 
AC; otherwise, the AC is zero. 



(END) 






I dent ificat ion 

MAD, FORTRAN on-line input compatibility 
(CSH), .FEAD, . BEADL, .LOOK, .SCRDS 

Purpose 

MAD and FOBTBAN OQ-line input statements compile as calling 
sequences to library subroutines. These subroutines use the 
consola as the input device instead of the card reader. A 

data list and format statement are required. 



Usajge 



MAD: BEAE FOBMAI FMT, LIST 

FAP: TSX .READ, 4 or TSX .BEADL, 4 

STR FMT,,DIR or STR SYHTB, DIR ,FMT 

OPS 

STR LIST,,ENDLST 

OPS 

SIR 

FCRTRAN: HEAD FMI, LIST 
FAP: rSX {CSH),4 

PZE FMI,, SWITCH 

OPS 

STB 

STQ LIST,t 

OPS 

TSX (BTM) ,4 

MAD: LOOK AT FORMAT FMT,LIST 

FAP: rsX .LOOK, 4 

STR FMT,,DIR or STR SYMTfi,DIfi, F«T 

OPS 

STR LIST,,ENDLST 

OPS 

STR 

FAP: TSX .SCRDS,4. 
PZE BUF, ,'n« 

.READ and (CSH) read lines from the console 
according to the format FMT and LIST. 

SWITCH if non-zero indicates that the format is 
enclosed in parentheses and stored forward. 

CES aay be indexing or other instructions. 

LIST is the beginning location of the LIST. 

ENDLST is the final location of the LIST. 



CTSS PROGRAMMER'S GUIDE Section AG. 1.06 8/65 



DIB if zero the format is stored forwards. If 
1, the format is stored backwards. 

SYnIB iu a Mhl call refers to the start (bcttoo) 
of the symbol table for this routine. 

EUF is the first (lowest) location of an array 
into which data will be read. 

n is an integer indicating the number of 
words to be read into the array BUF. 

, LCOK reads one line from the console according 
to the format specified by FWT. The next 
time a read statement is encountered, the 
same input will be processed. If more than 
one line of input is requested by the 
format, the same line will be used. 

SCFDS reads a line from the console and stores 
the number of words requested into the 
buffer. 



(END) 






lientif ication 

MftD, FORTRAN on-line output compatibility 
(SPH), (SFHM), .PRINT, . COMNT, .SPENT 

Purpose 

MAD and FORTRAN on-line output statements compile as calling 
sequences to library subroutines. These subroutines use the 
console as the output device instead of the printer. 

Usaie 

HAD: PRINT FORMAT FMI , LIST FAP; TSX .PRINT, U 

PRINT CNLINE FORMAT FMI, LIST TSX .C0MIIT,4 
FAP: TSX .PRINT, 4 or TSX .COMNT, U 

STR FMI,,DIH or STB S YMTB, DIB, FMT 

CPS 

STK LIST,,ENDLST 

CPS 

STR 

FORTRAN: PRINT FMT, LIST 
FAP; 



TSX 


(SPH),U 


PZE 


FMT,, SWITCH 


CPS 




LDQ 


LISI,t 


STR 




OPS 




TSX 


(FIL),U 



FAE: TSX .SPRNr,^ 
PZE BUF,,'n« 



(SPH) and (SPHM) are synonymous. 

.PRINT and .COMNT are synonymous, 

.PRIST and (SPH) type on the console the output as 
requested fcy the format FMT and LIST, The 
maximuni line length is 22 words. 

SWITCH if non zero indicates that the format is 
stored forward. 

SYMTB in a MAD call refers to the start (bottom) of 
the symbol table for this routine. 

OPS may be any indexing instructions. 

LIST(,t) is the beginning location of the list. 



CTSS EECGBAMMER*S GUICE 



Section AG. 1.07 



B/65 2 



ENDLbT is the final location of the list. 

DIR if zero, the format is stored forwards. If 1, 

else, a symbol table is implied. See MAD 
manual for details. 

BUF is the first (lowest) location of an array 
containing BCD information. 

n is the number of words in the array BUF. 



(END) 






Identification 

Print a comment 
.PCOWT 

Putfiosa 

To print a comraent from a MAE or FAP program on the user's 
consola without a format statement. 



ysa3.e 



MAD: PRINT COMHEMT $HESSAGE$ 

FAE: TSX $. PCOMT,U 

TXH "n* 

BCI 'n', MESSAGE 

MESSAGE is a string of no more than 132 Hollerith 
characters. The characters may not include 
dollar signs. 

n is the number of BCD words to bs printed. 



(END) 






i dentif ication 

Print variables without format 
.PHSLT, .PRflCD, .P80CT 

Purpose 

To print a list of variables on the user's console from a 
MAD or FAP program without specifying a format statement. 

ggf arence 

HAD Manual, Chapter 11, Section 2. 16 

Usacje 

MAD: PBIHr RESULTS list 

PBIHT BCD RESULTS list 
PRIUr OCTAL results list 

FAE: rsx $.PRSLr,a (or .PRBCD or .PROCI) 

IXH SYMTB 

rXH A 

TIX LIST1,,LISTN 

TXH 

SIHTB refers to the start (bottom) of the symbol 
table for this routine. 

A refers to a single element, 

LIST1 refers to the block of data. 

LISTN refers to the end of a block of data. 

TXH Barks the end of the list. 

The values of the variables designated by the 
list are printed on the user's console 
preceded by the corresponding variable name 
and an equal sign, e.g., 

X = - 12.4 
Bl(K:ks are labeled as such and are printed 
using a block format. Elements of three 
and higher dimensions will be labeled with 
the equivalent linear subscript. If dummy 
variables are included, the specific valaes 
assigned to such variables and expressions 
during execution will be preceded by *.,.'. 



CTSS EFCGRAMMER'S GUIDE Section AG. 1.09 Page 



PRINT RESULTS (.PRSLT) causes the output to be 
numeric (that is, integer or floating 
point) . 

PRINT BCD RESULTS (.PBBCD) causes the output to 
be printed as BCD inf ormaticn. 

PRINT OCTAL RESULTS (.PSOCT) causes the output to 
be printed as octal information. 



(ESD) 



CTSS EBGGH AMMEH '3 GUIDE Section AG. 1.10 8 '65 



R3dd without list oc format 
.KDATA, .RPDTA 

Purpose 

To raad data from the console without specifying a list or a 
format statement. The data items are identified by their 
variable names as they are typed. The data may be read and 
printed with one statement. 

Reference 

MAD Manual, Chapter II, Section 2.16 and 1.1 

fi 3strictions 

An input line is limited to 72 characters. If character 72 
is used, an implied comma is interpreted as the 73rd 
character. If mere than 72 characters are input in one 
lina, no error message will be printed, but errors will 
result in the input data. 

Usa^e 



MAD: 


READ 


DATA 


FAP: 


TSX 


$.RDATA,U 




TXH 


SYMTB 


MAD: 


READ 


AND PRINT 


FAP: 


TSX 


$. RPDTA ,4 




TXB 


SYMTB 



DATA 



SYMTB is the start (bottom) of the symbol table for 
this routine 

BEAD DATA reads information from lines typed on 

the usee's console. The values to be read and 

the variable names are typed in a sequence of 
fields of the following form 

VI = n1, V2 = n2, , Vk = nk * 

where the V are variable names and the ni are 

the "corresponding values. Reading is 

continued from line to line until the 
terminating mark •*• is encountered. 

READ AND PRINT DATA reads the data as explained 
above, and then immediately prints it cut. 

In case of an input error, a message is 
printed on the user's console. Included in 
this message are the type of input ertcr, the 
line in which the error occurred, the column 



CTSS EBCGRAMM£B'5 GUIEE 



Section AG. 1. 10 



8/65 



number in which the error was found, and the 
recovery procedure. If the user wishes, he 
may retype the offending line and all 

zauCCeeuXiJ^ UJiTiia, J. 11 uL^ifi. 

otherwise, he may terminate his 
*QDIT» signal. He may then use 
other debugging coamand. 



program by the 
the PM or any 



(END) 



uiD3 fKUVaKftnnciK ' D K3U1.UC aeutiuii juj, i. i i o/ d:» i 

Identif icatj^gn 

No- break mode 
SETNBK, KILNEK 

Pur£Osa 

As the CTSS supervisor receives input characters from a 
ussr, it normally waits to accumulate a whole line before 
signalling the user that he has input, so that the user 
program goes intD input wait status until the break 
character (carriage return) is struck at the console. A 
special mode, no-break mode, is available for those 
applications where the user program wishes to be informed of 
input as soon as it arrives. 

ysag.e 

As a supervisor or library entry: 

ISX SElIiBK,4 optional {TIA =HSETNEK) 

SETNBK will cause the supervisor to set no-break mode 

for the user. Subsequent calls to RDFLXA will 

return as soon as any characters have been 
typed. 

rSX KILMBK,1 optional (TIA =HKILNBK) 

KIINBK will restore the normal mode. 



(END) 



ciDD t pv. vjHHnn Ci K " 3 uuii>r, oe«-i.xuii t\u, i. i^ a/os 



Ii§. Unification 

Print a message on the console 
PHMESS, ERMESA 

Purpose 

PBMESS provides a convenient way for the RAD progranmer to 
type output en his ccnscle. 



Usdjje 



PBMESS. {$Lir£RAL$,?AB,¥AB(0) ...N, . , .) 



PBMESS types the massage which is the concatenation of 
all its arguments. Any number of arguments may be 
supplied. Note that BAD compiles the right code 
if a literal string of more than six characters is 
supplied as a single argument (it produces several 
arguments, one for each six-character chunk). 
PBMESS calls HBFLXA for ea::h 14 words it 
accumulates and then calls WRFLX for the last 14 
or fewer words specified. 

PRMESA works like PBMESS, but does not end the line with 
a carriage return. 

v3:;tors may be specified in the form VAE(0),..N to type 

out a vector of S vords running backwards in cere, 

or VAR (N) ...MINUSH (where HINOS* contains -N) to 
type vectors stored forwards in core. 



Example 



V«S Ml = JIHE ANSHEB IS$ 

PBMESS. (Ml 3,BZBL. (DERBC. (I) ) ,$ FUBLCNGSS) 



Would type: 

THE ANSWEB IS 15 FOBLONGS 

If the value of I was 15. 



(EUD) 



VM / \J -/ 



IlSHtifi cation 

Full-mode output from MAD Frcgrams 
PH12, Pel2fl 

Pur£osa 

PR 12 provides the MAD prcgranmer with a convenient method of 
producing output in upper and lower case without sacrificing 
program readability. 



Usa^e 



FB12, ($LiriRAL$, V AR, VEC...N, etc) 



PH12 takes its ECB arguments and expands them according 
to the escape conventions described below. It 

calls WRFLXA for every 28 words it accunulates, 
and finishes with a call to WRFIX for the last 28 
or fewer words. 

PR12A works like PR12 except that it does not end the 
line with a carriage return. 

Arguments to PH12 and PR12A may be specified like the 
arguments to PRMESS: that is, vectors running either 
forwards or backwards in core may be printed as well as 
single variables. PHMESS and PRftESA are secondary 

(na^ative) entry points to the program to save core space 
for programs which call both. Output is produced by calling 
HRFLX or HRFLXA with a prefix of MON, so that 12-bit mode is 
forced and the current character mode switch is unchanged. 

JS£.i.£^_ £ gnventipns 

The character-escape conventions have been chosen to save 
spa:;3 and to have some mnemmonic value. The character which 
signals an escape is the apostrophe ( •) . Any character not 
pracedad by an apostrophe prints as itself, except that 
letters are printed in lower case. The following table shows 
tha mapping performed. 

LUfilit EEiS.ted 

A a 

»A A 

etc etc 

« t 

• • 

• ( $ 
•) ? 
1 1 « 

• = •• 



CTSS PROGRAMMER'S :;UIDE 



Section AG. 1. 1 3 



6/69 



I . 



• + 


& 


1 


• 
• 


'1 


red shift 


»2 


black shift 


'3 


< 


•4 


> 


•0 


null 


»5 


% 


V 


tab 


• ♦ 


carriage tetur 



The following special operators are defined: 



•6 
•7 
•8 
•9 



enter BCD mode 
return to full mode 
end of argument 
end cf all text 



After '6 is recognized, no escape sequence except •? and '8 

will ba active, and all letters will be upper case. When '8 

is seen, PR 12 immediately goes to the next argument. When *9 
is seen, PB12 dumps its buffer and returns. 



Example 



V»S M2 = $'7 NOT FOUND. *G0 CN» ) 'BS 
FB12A. ($«6»8$,N1,$ 'BS, N 2, M 2. . . 10) 



Might produce the following: 

ALPHA OUTPUT not found. 3o on? 
With no carriage return at the end of the line. 



(END) 



i ^^n t i f ica t i c n 

Print 12-bit lines 
PHFULL,PHFULA,PRICHR 

Purpose 

To print a fenced Dr unfenced message containing 12-bit 
characters on the console with a routine that nay be called 
by MAD, 



ysa_cje 



MAD: FBFULL. (A,E...N) 

PRFULA. (&,B,C...II) 
EBTCHB. (SUER.) 

FAP: XSX JFeFULL,4 or TSX $PRFULA,U 



rsx 


JFeFULL,4 or 


PZE 


A or A, TAG 


EFA 


B or B,TAG 


PAP 


C 


PAR 


D,,N 


ELK 


E,,M 


TSX 


$PHICHR,4 


FAP 


SUER 



PRTCHR.(SUBR.) causes each 12-bit output character to be 
given to 'SUER.' (by •EXECUTE SUBR. (CHAR) •) instead of 

printing it. This node may be terminated at any time by 

TSX $PRTCHR,'4 or PBTCHR. (0) 

PAR 

PRFULL adds a carriage return at the end of the output 
string, PRFOLA does not. 

The calling sequence is of indefinite length, all arguments 
ara concatenated to form one continuous character string. 
Blocks are normally processed backward from X(0) to X(H) ; if 

N is nagative the block will be processed forward. 'X 0« 

is ignored. For • PA E X,,N» arguments, if N> 16383, it is 
considered negative and the count actaally used is 32768-N. 
Any argument will be terminated if a fence (octal 77. .,77) 
is encountered within it. The setting of the FUL-mode 

switch (SETFUL, SET BCD) is not affected. 

To facilitate the use of 12-tit characters from MAD and PAP 
programs the character apostrophe has been made to modify 
tha character that follows it, usually into an otherwise 
inaccessable 12-bit character but sometimes into a control 
function. Upper case letters are normally converted into 
lowar case. If an apostrophe is followed by a character 
that does not have a modification defined, tha apostrophe is 



CTSS EFCGRARMER'S GUICE Section AG.1.1U 6/69 2 

ignored. 

A complete list of modifications is: 

•ddd where ddd is octal: the 12-bit character whose 

octal code is ddd is printed 
»d where d is thru 7: the next d letters are printed 

in the case opposite from that in which they 

would otherwise have been printed 
•8 ignore the remainder of the current word 

tg erd of output string 

*- " 

•♦ S 

• A a 

•B black ribbon shift 

»F print-off 

» H hang- up 

'. ! 

•) > 

•: backspace 

t . 

•L print succeeding letters in lower case 

• N # 

»0 print- on 

•F % 

•Q ? 

»B red ribbon shift 

»♦ carriage return 

•space null 

'/ backslash or cent sign 

•S $ 

• T tab 

•U print succeeding letters in upper case 

•VI 

IX end this argument and print the next exactly as given 



(END) 



li>cc: 



Unbuffared disk string read and write 
DSKDMP, .DUME, .LOAD, CSKLOB 

Purpose 

To write or read a continuous block of core on (from) the 
disk as a file. These routines are usually used for large 
blocks of core, cr short files. 

y sa g^e 

Iwo routines are available as supervisor entries and library 
sntrias. An additional routine is available in the library 
which may be called by MAD and Fortran programs- 

To write a file en the disk: 
Core-B write around: 

rSX .DUMP, 1 
OPN FILHAM 
P«E LOC,,»n« 

OPN establishes the mode of the file{ ; PZE is 
teapocacy, PON is permanent, PTK and ETH are 
read-only, protected. 

FILNAH refers to the file name which will be placed 
in the current file directory, deleting any 
older file of the same name. 

LCC is the initial location from which n words 
will be written on the disk. 

To read a file: 

Core-B write around: 

TSX .LOAD,U 

PZE FILM AH 

PZE LOC,,»n» 

SLH M 

n is the number of words to be read. It may be 
larger than the actual file size with the 
following restriction: LCC+n-1 must be less 
than the memory bound. FSTATE may be used to 
estimate n. 

M will contain the number of words actually 
loaded, as a full word integer. 



CTSS PROGRAMMER'S SUIDE Section AG. 2. 01 11/65 2 



Corresponding library subroutine: 

MAD: EXECUTE DSKDMP^ (FI 1 NAM ,FI BST , N) 
EXECUTE DSKLOD. (FILN AM, FIRST, N ) 
M = DSKLOD. (FILNAM,FIRST,!i) 
FCRTPAN: CALL CSKLOD (FILN AM, FIRST, N ) 
CALL DSKDMP (FI LNA M, FI EST, N) 
A = DSKLOE (FILNAH, FIRST, N) 



Core will be loaded or dumped from FIBST-n+1 
through FIRST. If the number of words ,ib, in 
the file is less than n, the file will load 
into the fclock of core through FIRST- n+m. 
Beth DSKDMP and DSKLOD call the file system 
directly, i.e., they do not call the core-B 
write arounds. 



(END) 



ux:sa fKuvaKanncK ■ D ^uj-uci ocjij tiuii h^j.^.u^ i i/oj 



IJSfliiJication 

Buffered disk input 

SEEK, .SEEK, .RE&DK, ENDBD , .EHDRD, BfiEAD, VBEAD, DfiJAD 

Pucfiosa 

To provide the facility to read fixed length, string or 
lina-marked disk files in the buffered mode by calls from 
FAP, MAD or FORTRAN programs. Records may be converted 

according to a format statement or may be transmitted 
without conversion. 

Method 

Disk files to be read must be located in the current file 
directory, the hardware aust be set in motion to locate the 
first track of the file, a buffer must be assigned to the 
file and the tracks must be read to fill up the buffers. 
All of this initial activity is accomplished by the user's 
call to SEEK in which he may specify buffer locations. If, 
however, the user doesn't care to specify a buffer, SEEK 
will assign available space hy extending the memory bound. 

Reading is accomplished by moving logical records out of the 
buffers into working cote. When a buffer becomes empty, the 
supervisor fills it by reading the next track of the file 
into it. After sufficient data has been read from a file, 
the user may release the buffer and put the file in inactive 
status by a call to ENDRE. 

§ X. s t rictions 

The library subroutines maintain a list of active files and 
assigned buffers. There may be no more than 10 active files 
and no more than 20 automatically assigned buffers. 

Reading by calls to the core-B write arounds instead of the 
library subroutines means that buffers are not automatically 
assigned, only one buffer can be used, errors cause 
execution of supervisor error procedures rather than the 
library error procedures, and the write- arounds to the new 
file system are used. 



CTSS EBCGRAMMER'S GUIDE Section AG. 2. 02 11/65 2 



Usaje 
To 



pa n a file: 




as coce-B write 


atcund: 


TSX 


.SEEK, 4 


PZE 


FILHAM 


P2E 


BU1 1 



as library subroutine: 

FAP, MAD, cr POBIRAM, 

EXECUTE SEEK. ( FILHAM ,-BUF 1- ,-BUF 2- ) 

BUF1, BUF2 are initial locations of U32 word blocks of 
core tc be used as buffers. If no buffer is 
specified to the library subroutine, one 
buffer will be assigned by extending the 
memary bound if core space permits. If no 
buffer space is available, the library error 
procedure will be initiated. If two buffers 
are provided, reading will be more efficient, 
since I/O may te overlapped with processing. 

SEEK calls S8CH which assigns a buffer, if needed, 
by calling FREE and maintains an active file 
table and buffer assignment table. 

.SEEK does not call SRCH. 

To read a record : 

as core-B wrote around: 



TSX 


.RBADK,4 


P2E 


FILM AM 


P2E 


LOC,t,n 


P«E 


Ej0F 



EOF SLH WC 

n words will be moved from the current buffer 
associated with FILHAM and stored in a block 
of core beginning at location LOC. n may be 
larger than the actual file size but LOC+a-1 
must be less than the memory bound. 

t of non zero means skip n words without 
transmission. 

ECF If an attempt is made to read beyond the last 
word of the file FIISAM, control is 



L'Xbb f MUiiKAiinjiK 's JUiuts :>e(jxi.ou ali.^.u^ < i/od 



transferred to location EOF. 

HC upon end of file return, the AC will contain 
the number of words actually read, as a full 
word integer. 

I A a ±A.ui.at.j o uu J. u u t. J. lie ^ 

FAE or MAD 

EXECUTE BREAD. (FIINAB, IIST) 
EXECOIE DEEAD. (FILNAM, FORMAT, LIST) 
HC = VREAD. (FILNAM, LIST) 

LIST is any mixture of single variables and bloclc 
notation vectors locating the variables to be 
read, if any. 

FORMAT is the location of the format by which the 
variables in LIST will be edited by (lOH). 

BREAD will read the n words specified by the LIST. 
n Bay be any size. No attention is paid to 
logical record breaks. If the input file is 
line-marked, the line-marks will be nioved as 
data words. 

DREAD reads logical records and edits them through 
(lOH) . Each call to DREAD reads at least one 
logical record; however, the format may 
require the reading of more than one logical 
record. If the file is line-marked, the line 
marks delineate the logical records. If the 
file is not line-marked, the logical records 
are lU words. If fewer words are requested 
than are available in the record, the excess 
of the record is lost. The format may specify 
the reading of more than one record; however, 
if more words are requested from a specific 
record than are available within that record, 
the library error procedure is initiated. 

VBEAD will read one logical record, A logical 

record is either delineated by liae-marks, set 
by SEIVBF, or assumed to be 11 words. The 

LIST may net exceed 22 words. If the LIST is 
longer than the logical record, the end of the 
list will be padded with blanks. If the LIST 
is shorter than the logical record, the 
reaainder cf the record will be lost. If the 
record was fixed length, the sign of WC will 
be minus. If the record was line-marked, WC 
will be positive. XC is a properly formatted 
integer but Fortran may have some difficulty 
because of the function naming conventions. 



CTSS FFCGRAMM£R'5 GUICE Section AG. 2. 02 11/65 U 



To close an input file: 

as core-E write around: 

rsX .EHDBD, ii 
P2E FILNAH 

as library subroutine: 

FAP, MAD^ or FORTRAN 

EXECDTE EIJDRD, (FILNAM) 

ENDRD will delete the file from the active file 
table and release the buffer. 



(END) 






liSIiii.£.i.cation 

Buffered Disk Output 

ASSIGN,, AS IGN, APPEND,. APEN D, . W RITE, FILE, .FILE, B-D- V-P WHI TE 

Purpose 

To provide the facility to write fixed length, string or 

line-marked disk files in the buffered mode. Records may be 

converted according ta a format statement or they nay be 
transmitted without conversion. 

Method 

The file must be defined and placed in an active file table 
and buffers must be assigned. This initialization is 
accomplished by ASSIGN or APPEND. Writing then causes data 
to be moved from working core into the buffers. When a 
buffer is full, it is written on a track of the disk by the 
supervisor. A file in write status oust te closed by FILE 
in order to assure that the last buffer has been written on 
the disk and the file name is entered into the file 
directory. 

£^s t r ictions 

IE the library subroutines are used, an active file table 
and assigned buffer table are maintained. There may be no 
mora than 10 active files and 20 automatically assigned 
buffers. If the prcgran is terminated by any terminal 
library routine, all files in write status will be properly 
closed. Any disk errors will initiate the library disk 
error procedures. 

If the core-B write arounds (.ASSIGN, .AEEND and .HRITE) are 
used and the program is terminated without going to .FILE or 
EXIT, the file will be lost. EXIT has been modified to 
include a CICS E. ($ALL$) . Any disk errors initiate I/O 

system error procedures. Only one buffer can be used with 
calls to the core-E write arounds. 

For any given file, calls to the library subroutines may not 
b3 intermixed with calls to the core-B write arounds or I/O 
system entries. That is, buffers may not be assigned by 
.ASIGN with reading being done by BWRITE, etc. 



CTSS PROGRAMMER'S GUIDE Section AG. 2, 03 11/65 2 



ysac[e 

To open a new file: 

core-B write acoiind; 

rsX .ASIGN, U 
OPN FILMAM 

pa E BU F 1 

as a library subroutine: 

EXECUTE ASSIGN. (FILMAM, -BDF1 - ,-BUF2 -, -ED F3-) 

DPN defines the node: P«B is tsmporary, POM is 
permanent, PIW and PTH are read-only 
protected. The library sutroutine wi]l define 
the mode as permanent. 

BUF1,BUF2,BUF3 are the initial locations of 432 word blocks 
of core to be used as buffers. If no buffer 
is specified for the library subroutine call, 
two buffers will be assigned by extending the 
memory bound, if core space permits. If no 

buffer space is available, the library error 
procedure will be initiated. Writing with 

only one buffer is extremely inefficient since 
it forces the use of MRHAIT. Two buffers 

greatly increase efficiency because this 
allows use of the core-B buffering routine 
BFHRir. Three buffers make it possible to 
overlap I/O with processing. 

ASSIGN calls SRCH which assigns two buffers if 
necessary by calling FREE, and maintains an 
active file table and buffer assignment table. 
This allows terminal subroutines tc close 
active files properly. 

.AS.IGM does net call SRCH. 

ASSIGN and .ASIGM If a file already exists named FILMAM, it 
is deleted. 

To opan an old file in order to add infomation: 
core-B write arcund: 

TSX .APEMD,U 
PSB FILNAH 
P2 E BU F 1 



1 1 y£. C 
I I / \J J 



as a library subroutine: 

FAP, MAD or FORTRAN 

EXECUIE APPEND- (FI INAM, -BUF 1-, -BUF2-,-EUF3- ) 

APPEND is the same as ASSIGN except the file name is 
located in the file directory and data to be 
added to the file will be written at the end 
of the existing file. 

To write a file: 

core-B write arcund: 

TSX .WRITE ,4 
PZE FILNAM 
P«E LOC,,'n' 

n is the number cf words to be written into file 
FILNAM beginning at location LOC. 



as a library subroutine: 
FAP, MAD or FORTRAN 



EXECUTE BWaiTE. 


(FILNAM, LIST) 


EXECUTE DWHITE. 


(FILHAK, FORMAT, 


WC = VWPITE. 


(FILNAM, LIST) 


WC = F WRITE. 


(FILNAM, LIST) 



LIST) 



LIST is any mixture of single variables and bloc)c 
notation vectors locating the variables to be 
output. 

FORMAT is the fornat by which the variables in LIST 
will be edited through (ICH). 

BWBITB will write the n words specified by the LIST 
as a record without line marks, LIST nay be 
any length. 

DWHITE will write the n words specified by LIST as a 
line-marked record after they have been edited 
by (lOH) . (3 .IE. n .LE. 22). If n . L. 3, 
blanks will be filled in until the record is 3 
words long. If the combination of FORMAT and 
LIST specify a line longer than 22 words, 
(ICH) will type an error message and then call 
RECOUP. 

VWHITE will write the n words specified by LIST as a 
line-marked record. 3 ,LE, n .LE. 22 (same 
convention as DHRITE). WC will contain an 
integer egual to the number of words written 



CTSS PROGHAMMER'S C5 CIDE Section AG. 2. 03 11/65 U 



(net including the line-mark). The actual 

record length is WC+1.. 

FWBITE will wtite a fixed length record without 
line- marks. If the LIST is shorter than the 
fixed length. Hanks will te filled in. If 

the LIST is longer than the fixed length, only 
the first words are written and the excess is 
lost. The fixed length is assumed to be 14, 
unless set by SBTVB{F) , wc will contain an 
integer egual to the number of words written, 
the sign will be minus. 

WC when WC is returned, it is the proper integer 
format for the language of the calling 
prcgram. Fortran, however may have some 
difficulty as a result of the mode of the 
function convention. Fortran users should 

equivalence HC with an integer variable. 

To c;lose an output file: 
core-B write around: 

TSX .FILE ,4 
PZE FILNAM 

as a library subroutine: 
FAE, BAD, or FOBTfiAN 

EXECUTE FILF. (FILNAH) 

FILE will cause any active buffers to be written on 
the disk, FILHAM will be entered into the 
current file directory, the buffers will be 
set free, and the file removed from active 
status. If the library subroutines have been 
used to write the file, a call to any terminal 
subrautine (EXIT, DUMP, etc.) will cause the 
calling of FILE for all active files. 

.FILE should be used only if the file was written by 
the .WRITE write around. 



(END) 



urbb tDVitartflnn in 'D lauXiJc ae^-txuii aij.^.uh II/oS 



Jiaatifi cation 

Aditessable disk files 
. RELBH 

Pur£Ose 

To allow disk files tD be treated as addressable secondary 
mamory. Relative locations within a disk file may be 
specified for reading or writing. 

Usa^e 

To open an addressable file: 
core-B write around: 

TSX .BELRH,'* 
P2E FILNAH 
P2E BDfl 

. RELBW will open an addressable file which oay be 
read or written. If writing, the node is 
pe inanent. 

fiUFI is the initial location of a buffer whose size 
should be at least 432 words. 

To read or write an addressable file: 
core-B write around: 

rSX .eiADK,4 TSX ,HBITE,U 

PZE FIlNAM,,reladr 

PZE LOC,,»n» 

PZE EOF 

rsladr is the relative location within the disk file 
where the reading or writing will begin. The 
first word is number 1. If reladr is outside 
the limit of the file, the nor»al end-of-file 
procedure will be followed for reading or the 
supervisor error procedure will be followed if 
writing. 

LOC,,'ti* n words of cote beginniag at location LOC will 
be read from or written in the disk file 

FILNAtt. 

ECF Location to which control will be transferred 
upon encountering an end of file. 






Set the length of fixed length records 
SBTVBF, SETVE 

Pur£Ose 

Records which are read cr written by FHBITE or VREAC may be 
fixad length. The normal fixed length is 14 words. If a 

different length is desired, SETVBF may be used to specify 
the langth. 

Usa^e 

As a library subroutine: 

MAE, FAP, or FOBTBAN 

B = 3EIVBF. (N) 

SETVBF and 5 ETV B are synonymous. Both nanes are 

provided because of the Fortran function 
naming convention. 

N is (location of) the nuaber of words to be 
considered for fixed length records by PWBITF 
or VHEAD. N may not fce greater than 22. If N 
.GE. 22, the record length is sat to 22, 

B will contain the previous setting of the fixed 
record length. 



(EHD) 



1 1 j£ c 



i^^nt if i cation 

S^Lvica to library disk routines 
SHCH, BLK, FLK, EMDF , CLOUT 

Pur^osa 

Service routines are available to the library disk 
subroutines to assign buffers, find files, maintain the 
a-tiva file and buffer tables, and close out files. 

Ugaag 

To search active file table: 

rsx sRCH,a 

PZE FILNAM 

not found 
found 

not found return aeans that FILNAM was not found in the 
active file taiile. 

found returns with the status of FILNAM in the 
address of the AC and a buffer number (1-20) 
in the decrement of the AC, If the file is not 
using an assigned buffer, the buffer number is 
zera. Write status is 1; read status is 2. 
The sign is + if enough buffers are assigned 
to use core-E buffering routines (BFREAD, 
etc;). The sign is - if supervisor I/O must 
be used. 

To assign a buffer: 

TSX BLK, a 

error return 
normal return 

BLK searches the buffer assignment table. If 
there are no free buffers and there are fewer 
than 20 assigned buffers, an attempt is made 
to extend the meaory bound by a call to FRFH. 

error return is taken if there are already 20 
buffers assigned or the attempt to extend the 
memory bound was unsuccessful. 

normal return is taken with the address of the buffer 
in the address of the AC and the number af the 
buffer (1-20) in the decrement of the AC. 



CTSS EPOGEAMMER'S GUIDE Section AG. 2. 06 11/65 



To antar a file in the active file table: 



ISX 


ELK, U 


PBE 


FILNAM 


PFX 


Sta tus, ,PTR 1 


PZE 


,,PRT2 




ecror return 




normal return 



status is 1 if writing, 2 if reading. The status 

word is stored in the first free space in the 
active file table. 

PTR1,PTR2 is the buffer number. If number is non-zero, 
a pointer to the file in the active file table 
is placed in the assigned buffer table. 

PFX is P£E if enough buffers are assigned to use 
ccre-B routines (BFRE&D, BFWHITE) ; otherwise, 
it is M2E. 

arror return is taken if there are 10 active files 
already. 

To remove a file fzow the active tables: 

TSX ENCF,U 
P8E FILNAH 

The buffer is freed, and the fila is removed 
from the active table. The file is not 

closed. 

To remove a file from the active tables: 

rSX CLOUT, »» 

All the files are closed by calls to CLOSE and 
BFCLOSE. All buffers are freed and returned 
to "free storage". 



(END) 






I3ent if i cation 

G^narata file of zeros 
.CLEAR 

Purpose 

To create a new file which contains n zeros. 

Usajje 

Cora-B write around: 

rsX .CLEAH,U 
OPN FILNAM,,»n' 

.CLEAR will create a file of the name specified in 

FILNAH which will contain n zeros. The 

opening and closing of the file are 

accomplished by .CLEAR so that .ASIGN and 
.FILE should net be called. 

OPN specifies the mode of the file: P2E is 
temporary, PON is permanent, PTW and PTH are 
read-only and protected. 



(END) 



L;iSi) fKuGKAiinER'S GiJlDE Stsutiou AG. 2. 08 '!2/&& 



I ^ en t i f i ca t i G n 

Input and output 

OPEN,B0FFER,HDFILE,HDWAII,WRFILE , HR WAI T ,T BFILE 
FCHECK,FWAIT,CLOSE,SErPRI 

Filas may be opened on any I/O storage device for reading, 

writing or reading and writing. A file which has been 

successfully OPENed is said to be "active". A '-•''"=-- ^" 

assigned if needed and priorities may be set f 
files, 

M:jthod 



buffer may be 
or different 



It is assursed that the user is familiar with section AD, 2 
and AG. 4. 06 of this manual. In order to read or write a 
fila, the file must first be opened and in most cases a 
buffer should be assigned. Calls to RDFILE or WRFILE 

initiate the I/C for a relative location within the file. 
The actual data transmission is not completed upon return 
from the call. A subsequent RDFILE, WRFILE, FCHECK, or 
CLOSE is necessary tc conplete the data transmission and I/O 
arror checking. All calling sequences will accept the two 
extra arguments for the errcr procedure. Any arguments 

whi::h are not pertinent may be specified as -0. 

Usaje 

OPEN: 

OFEN,($STAIUS$,$ !IAME1$,$ »AHE2$ , BCDE, DEVICE) 

STATUS may be *A* for read, • M* for write or • Ri ' for 
read-write. (justification is not 

significant) . 

HODE specifies the mode of a new file to be created 
and may be the inclusive logical or of any of 
the following octal values. If MODE is not 
specified, a permanent file will be created. 

000 - Permanent 

001 - leaporarj 
00 2 - secondary 
OOU - Read-only 
010 - Hcite-only 
020 - Private 
100 - Protected 

DEVICE is pertinent only when creating a new file and 
it specifies which I/O device is desired. If 
DEVICE is not specified, the system will 



CTSS PFCGBAMMER'3 GUIDE Section AG. 2. 08 12/66 2 



assign a device. 



1 - Low speei drum 
3 - rape 



Ertcr cedes: 



03. File is already in active status 

nu, Moce than ten active files 

05. $STAIIJS$ is illegal 

07. Linking depth exceeded 



08 



File in » PRIVATE' mode (different author) 



09. Attempt to write a •READ-ONLY' file 

10. Attempt to read a » WRIIE-CHLY' file 

11. Machine or System error 

12. File not found in U.F.D. 

13. Illegal device specified 

It*. Nc space allotted for this device 

15. Space exhausted for this device 

16. File currently being restored from tape 

17. Input/Output error, see AG.U.06 

18. Illegal use of M.F.D. 

19. U.F.D. not found (i.e., CFEN through a link) 

20. Attempt to read secondary mode file. 

Assign a buffer: 

BUFFER. ($ NAME1$,$ NAHE 2$ ,BUF ( S) N) 

BUFFER In general a buffer should be assigned to an 
open file for reading or writing. 

BUF The buffer space should be specified in block 
notation as the beginning location of the 
buffer and the size. The si 2a must be large 
enough to accomodate a physical record from 
the I/O device. 

N is the buffer size and U32 seems to be the 
going size. 

Error codes: 

03. File is net an active file 

04. ■ Previous I/O out of bounds (aembnd changed) 

05. Buffer too small 

06. Input/Output error, see AG, 4. 06 



Sst priority: 



SirPRI. (PRIOR) 



i 1 ic c 



SETPRI is used to assign priorities to certain tasks 
which wDuld otherwise be processed in the 
order in which they were received. When files 
are opened for reading and/or writing, they 
are assigned the priority set by the last call 
to SETPRI. If there was no previous call to 
SETPBI, all files will be treated with equal 
pr iority . 

PBIOH is an integer from 1 to 7. The higher the 
value the lower the priority. 

Errcr cedes: 

Standard error codes. See section AG. 4. 06 

R3a3: RDFILE. ($ NAME1$,$ NAME2$, RELLOC, A (H) . . .N ,EOF ,EOFC T) 

RDWAIT. {I NABE1$,$ N AM E2$, HELLOC, A (M) . . .N , E0F,EOFZ T) 

RDFILE initiates the I/O necessary to move N words of 
data into location A ( S) through Ai 1) from file 
NAME1 NAME2. 

RDWAIT is a single call which incorporates RDFILE and 
FCHECK so that upon return, the data has all 
been moved and all of the error checking has 
been done. 

REILCC specifies the initial location within the file 
frcB which reading is to begin. If BELLOC is 
zero, reading continues from the word 
following the last word read from the file. 
On the first call to RDFILB either or 1 
specifies the first word. Bote that in a file 
which is open for reading and writing, there 
are two separate pointers (i.e., the last word 
read and the last word written) . 

EOF is the location to which control will be 
transferred if the end of the file is 
encountered before N words are available to 
transmit into &. If RDFIiE was called the 
words have not actually been transmitted to A 
so that FCHECK or CLOSE is necessary if data 
from A is to be used. The file is not closed 
by encountering an end of file. 

ECfCT is an integer variable wjiich will contain the 

by the call 
of file was 



is 


an integer 


variable wjiich will 


nu 


nber of word 


Is to 


be transmitted 


to 


REFILE 


when 


the end 


encountered. 







CTSS EI1CGEABMER«3 GU ICE Section AG. 2. 08 12/66 U 



Errcr cedes: 

03. File is net an active file 

OJ*. File is not in read status 

05. Nc buffer assigned to this file 

06. Previous I/O out of bounds (membnd changed) 

07. Input/Output error, see AG. U.Ob 

08. U.F.D. has been deleted 
Write : 

WBFILE. ($ NAME1$,$ N AM E2$, RELLOC, A (N ) . . . N , EOF ,EOFCT) 

WRWAir.($ NAME1$,$ N AM E2$ ,HELLOC ,A (N) . . . «,EOF, EOFCT) 

WBFILE initiates the I/O necessary to Daove S words 
frcin the array A(N) thru A ( 1) into the file 
NAME1 NAMB2. 

WHWAIT is a single call which incorporates WBFILE and 
FCHECK so that upon return, the data has been 
moved and error checking has been done. 

EELLOC is the relative location within the file where 
writing is to begin. If BELLOC is zero, 

writing will begin after the last word written 
in the file. If RELLOC is zero on the first 
call, writing will begin at the location 
following the last word of the file. RELLOC 

may not be larger than the current length of 
the file. 

ECF is the location to which control will be 
transferred if the N words to be written would 
have to be written through the end of file 
(i.e., if part of the record could be 
contained within the file and the other part 
would extend to outside the file) . This does 
not occur when appending to the file with a 
BELLOC of zero where entire records are placed 
at the end of the file, 

EOFCT is an integer variable into which the I/O 
system will store the number of words actually 
to be written when control was transferred to 
EOF. An FCHECK is necessary as with any 
WBFILE. 

Error codes: 

03, File^is not an active file 

OU. File is not in write status 

05, No buffer assigned to this file 

06. Allotted space exhausted for this device 



v^ X -> o u a.\j vji\ n iiii ^41 *^ ^ u jb. t^ t-^ •-»*- ^ w^ v.* »»«~« ._^,- - 

07. Ptevicus I/O out of bounds (membnd chanyed) 

08. Input/Output error, see AG.U.06 

09. Illegal use of write-only file (ccn-zerc 
•RELLOC) 

10. Max file length exceeded 



Xr u neat e; 



TRFILE.{$ NAME1$,$ NAME 2$ , PEILOC) 



TRFILE Ihe tile NAME 1 liAME2, which was previously 
Dpened for writing, will be truncated (i.e., 
cut-off) imiaediately tefore the relative 
location RELLOC. If HELLOC is less than the 
read or write pointers, they will be reset to 
their original places, (i.e., the read to the 
first word of the file and tha write to after 
the last word of the file). 

Error cedes: 

03. File is net an active file 

OU. File is net in write status 

05. No buffer assigned to this file 

06. Previeus I/O out of bounds (membnd changed) 

07. RELLOC larger than fil€ length 

08. Input/Output error, see AG. 4. 06 

09. Illegal use of write-only file (nen-zero 
•RELLOC) 



Chack: 



PCH£CK.($ HAME1$,$ NA (5E2$ ,FIMSH) 

P»IAIT.($ «AHE1$,$ BAHE2$) 

FCHECK is used to check to see if a previous read or 
write of a specific file has been ccnpleted 
and checked for errors. liote that RDFILE, 

HHFILE , TRFILE, and CLOSE incorporate an 
automatic FZHECK at the beginning so that if 
FCHECK is not called explicitly, any I/O 
errors are detected one call later than the 
call that caused the error. 

FHAIT is the sane as FCHECK except that control will 
not be returned to the user ufitil all I/O has 
been ccmpleted and checked. 

FINISH is the location to which FCHECK will return 
control if the I/O is completed and checked. 
If the I/O is not completed, FCHECK will take 
the nDrmal return. 



CTSS PHOGRAMKEK'S 3 LIDE Saction AG. 2. 03 12/66 6 

Error codes: 

03. File is not an active file 

0>*» Previcus I/O out of bounds (aienbnu Cuanysu) 

05. Input/Output error, see AG. 4.06 



Close : 



CLOSE. ($ NAHf1$,-$ NAME24-) 

CLOSE is used to close an active file and return it 
to inactive status. CLOSE incorporates an 
FCHECK for the last I/O call and initiates and 
FCHECKs the I/O necessary to empty any waiting 
output buffer. 

NAMEl may be » ALL' and NAHE2 not specified for all 
active files to be closed. 

Errcr cedes: 

03. File is net an active file 

Q^. Previous I/O out of bounds (meinbnd changed) 

05. Input/Output error, see AG.U.06 

6. Machine or System error 



(END) 



v-ioo r nuvin anniin • o sjuj-UJI Dtjui-xuu hvj.^.u':^ fdye 



I.^ 5 n t i f i c a t i c J] 

Loa3 a file into a free area of core 
LDFIL 

Purgosa 

To load a file into a fcee area of core, and then pass 
control to a specified function, giving information as to 
whare the file has been loaded and how long it is. 

Usa^e 

FAE 



rsx 


LEFIL,U 


PZE 


=H M HE 1 


PZE 


= « NAHE2 


PZE 


FUNCr 


- PZE 


ARG1 - 


-PZE 


ABG2 - 



MAD: LDFIL. ($ NAfiE1$ N AM E2$, PUKCT. ,- ARG 1- ,-AR32-) 

LDFIL loads the file N AM E 1 NAMB2 and calls FUNCT 
with the fcllowing call 

FAP: ISX FUNCT, 4 

PZE LOCAD 

- PZE AR3 1 - 

- PZE AeG2 - 

MAD: FUNCr. (L0DAE,-ARGl-,-ARG2-) 

LCDAD contains the exact word count (tfC, as an 
integer) of the file BAHEI KAME2. The file is 
loaded into locations LODAD + 1 ,. . - ,L0DAD + W3. 

ARGI ARG2 are optional arguments which LDFIL will 
transmit, if present, to FONCT. 

A return from FUNCT will automatically mean a 
return to the program which called LDFIL with 
all registers except index register 4 
preserved . 

LDFIL uses FRER, FRET and CCLT in addition to 
the I/O system routines. 

If sufficient space is not available to load 
NAMEl SAME2, LDFIL will c^ use a comment to be 
printed (by FREH) and call EXIT. 



(END) 






I/C. 


In order 


to 


opened 


with one 


or 


writing 


a file. 


one 



lixfitifi cation 

Buffered Input and Output 

BFOPBN, BFBEAD, EFWRII, EFCLOS, BFCODE 

Purposa 

Because entries to ccre-A and the file system involve quite 
a bit of overhead, it is advisable to provide for buffering 
and for all blocking and unblocking of buffers in core-B 
routines and to call the file system only to transmit full 
records. These (••OF- package") library routines are 

available to provide single or double buffering in core-B. 
Double buffering is definitely advantageous to programs 
which are "compute- limited" because it allows overlapping of 
CPU time with I/C time. 

Method 

Tha file system is used for all actual 
read or write a file, the file must fca 
two buffers specified. In the case of 
2 xtra buffer is always needed to assign to the file system; 
n^w files files opened by BFOPEN will be in the pernanent 
mode. Calls to BPfiEAD and BFWRIT cause words to be noved 
from (to) a buffer to (from) the user's work area. When a 
buffer is empty (full) it is refilled (emptied) using RDFILE 
(WRFILE) with RELLOC=0. If a second buffer were assigned 
(third in the case of a write file) it will then be used, 
otherwise a call to F2HECK will be made in order to reuse 
the single buffer. Actual data transmission to or from a 
file is initiated each time one of its buffers is empty 
(full). I/O error checking is completed fcy a call to FCHECK 
in the case cf a single buffered file or on a subsequent 
call to BDFILE or KRFILE for double buffered files. 

§S.§iEi£ii2Il§ 

Every call is a fixed length calling sequence so that each 
argument must be specified, either explicitly or by 
specifying -0. Only those arguments specifically stated as 
optional, by the minus (-) convention, may be specified by 

-0. 

All buffers must be U32 words long and the location 
specified in the calling sequence must spa^f y the lowest 
core location of the block because the data are loaded into 
the buffers in the forward direction. 

A maximuB of ten files may be open at any one time. 



CTSS f BCGBAMMER»5 GUIDE Section AG. 2. 10 1/66 2 

OPEN: 

KAD: BFOIfiN. (STAT,NAKE1,NAME2, BUF1 (t*32),-BaF2 (432 ) - ,-BUF3 (4 32) -^EBH) 

FAP: 



ISX 


BFOPBN, U 


TXH 


STAT 


rxB 


NAWE1 


TXH 


NAnE2 


TIH 


BUFI 


TXH 


-BaF2- 


TXH 


-BUF3- 


IXH 


EBR 



STAT toay be 'R* for read, *V* for write - where 
•R* or •«» is left justified in the word. 
(Any status other than »W« will be 
interpreted by BFOPES to be the same as 'R' 
and passed to the file system as given in the 
call. Thus, a status of 'RW ' will enable the 
user tD read and write the file, using BFPEAD 
for reading ani'wRFILE for writing. Because 
the BF-package considers the file open for 
reading only, calls to BFHBIT would result in 
an errar return. 

NAME1 KAME2 are the two locations containing the BCD name 
of the file. 

BUFn is the beginning location of a 432 word 
buffer. Reading requires one buffer for 
single buffering and two for double. Mriting 
requires two buffers for single buffering and 
three for double. 

EBB is the location to which control will be 

transferred if an error is encountered either 

by the file system or by the buffering 
routines, 

READ - WRITE: 

MAD: BFRE&D.{»AME1,N!IME2,A (N) . . . B ,ECF ,ECFCT ,ERB) 
BFHRIT.{NAHE1,NAI1E2,A (H) ...N,EBR) 
FAP: 



ISl 


BFRBAD,U 


ISX BFWRIT,4 


rxH 


NAHE1 


TXH NAME! 


IXH 


lAnE2 


TXH KAME2 


rxH 


A,,'n« 


'IlXJU#A,,«n» 


IXH 


EOF 


MH "■ ERB 


TXH 


B0rci 






1XH ERR 

BFHEAD(BFWRIT) transmits N words of data from (to) the 
current buffer assigned to file NAME1 NAME2 
into (from) location A ( N) through A(1). 

N i oic ' n' \ "* s t'^s runsbs*" '^** wojrd.s to b9 tirdnsisxttGci. 

EOF is the location to which control is 
transferred if the end of the data in the 
file is reached before N words can be 
transferred to location A |N) through A(1). 
Fcr writing this does not apply since RELLOC 
= 0. 

EOFCI is an integer variable into which is placed 
the number of words actually read when 
ccntrol was transferred to EOF. 

CLOSE: 

MAD: BFCLCS. (NAME1,MAME2, ERRJ 

BFCLCS is used to close an active file. If NAWE1 

NAnE2 was a write file, the incomplete buffer 
will be added to the file bafora closing. If 
NiHEl is 'ALL* and NAME2 is -0, all active 
files will be closed. 



ERRORS: 








MAD: ERBCCD = 


: BFCODI. (0) 








F&P: 


TSX 


BFCODE, a 






SIC 


ERHCCD 



BFCODE If called in the event of an arror return, 
gives a non-zero code word (key below) if the 
error was detected by the buffering routines. 
If the error was detected hy the file system, 
ERBCOD will be zero, in which case the user 
may call PRNTHR or lODIAG to discover the 
nature of the error. 



1. rco many active files - call to 
BFOPEM when ten files already were 
opened by BFOPEN. 

2. Not enough buffers given - Call to 
BFOPEN to open a read (write) file 
^nd no (only one) buffers 
specified . 



CrSS PPCGRAMMER'S GUIDE 



Section AG. 2. 10 



1/66 4 



3. Attempt to (BF) Lead (write) a file 
not opened by BFCPEN. 



Attempt to (BF) read (write) a 
opened for writing (reading). 



*; 1 r> 



(END) 



i d^n t i f i ca t i c_n 

Oil fila system write-arouads to new file system 

PU££OSa 

many commands) written for the old file system, a set of 
write- arounds has been written which map the old disk calls 
into the new ones. These are available as library 

subroutines, and operate in core B. Unfortunately, this 

niipping is necessarily imperfect. Following is a list of 
the more painful and obvious discrepancies. 

1. There is no .FILDfi. The U.F.D. (FILE) can be 
opened and read with the same calls as any other 
files. 

2. There is no double-fcuf fer ing. Calls to .SEEK, 
.APPEND, and .ASIGM use only the first buffer 
specified in the call (the one specified in the 
address) . 

3. It is not possible to have more than one file with 
the same name. Therefore, a call to .ASIGH first 
deletes any file that already exists with the 
given name. 

U. It is possible to create a file with a word count 
of 0. No telling how this incompatibility will 
shew up. 

5. Restrictions as to zero or non-zero 

relative addresses in calls to . BEACK/.H BITE 
following a . RELRW rather than .SEEK/.ASIGN have 
all been removed. Anything is legal. 

6. All files which are specified to be written as Bl 
or fl2 will be written as read-only, protected. 
Files which are created as read-only, protected 
will be treated as Hi. There are no files with 
the former restrictions of R2. 

A few conditions which formerly caused errors and no longer 
do were considered important enough to simulate. WARNING 
sin:;a these err3r conditions are recognized by the 
write- arounds rather than by the file system, attempts to 
gain more information about the error (e.g. via P8NTER) will 
be misleading and meaningless, 

1. "RELLOC too?" large" causes an EOF return from 
HRFILE, but an error return from .WHITE. 



CTSS PROGRAMMER'S GUIDE Section AG. 2. 1 1 12/69 2 



An FSTATE en a file in active write status gives 
valid iafartnation. For .FSTAT this results in an 
error return. 



Error returns and error codes constitute the area of 

no 
le 



greatest inequality. The prefix of an error return is n 
longer significant (i.e. if an error return is provided, th 
comuient is always suppressed). Also error codes meaning 
••file not found" (5), "too many active files" (2), and 

•■1. 1. „,.„4--> ^-t, v,^ ,ic- *-/i,ifi (f^\ are transla *"f^'1 - but all other 

arrors are mapped into the catch-all code 1 (illegal calling 
sequence). 

Approximate Mapping of Old Calls into Mew 



APEND 



FSTATE to Check for existence of file 

OPEN for Writing 

BUFFER 



.ASIGN DELFIL previous copy 

OPEN for writing 
BUFFER 

,SEEK OPE** ^OJ^ reading 

BUFFER 

^HELRW OPEN for reading and writing 

BUFFER 

,LOAD OPEN for reading 

REFILE 
CLOSE 

.DUMP DELFIL 

OPEN for writing 

WRFILE 

CLprSE 

.READK REWAIT 

.WHITE MRHAIT 

.CLEAR DELFIL 

OPEN for writing 
WBFILE n zeroes 
CLOSE 

.FSTAT F STATE 

.DLETE DELFIL 

.ERASE 



r-TC c corr^UAMMfDic mt T n u 






FILE 


ENDBD 


RENAW 


RESET 


FILDR 



CLOSE 

CHPILE 
RESETF 
"Subroutine not found" 



Mapping of Nodes 



Fil3 Craation (. ASIGN) 

Assigned mode 

Temporary 

Pertaanent 

Read-only, class 1 
Read-only, class 2 



Resulting mode 

Temporary 

Permanent 

Head only. Protected 



Fil3 Tasting (. FSI AT) 



Actual mode 

Temporary 

Read-only 
Protected 

All others 



Mode returned by .FSTAT 
Temporary 
Read only, class 1 

Permanant 



Nota that a write-only file will appear to a progran using 
.FSTAT to be permanent mode; the program may run into 

lifficulty if it then attempts to read the file. 



(ENC) 



L.i5:j tBCGRArinEH'S GUIDE 5«utiuu AG. 3. 01 11/oj 



J^.3 S ^if ica ti on 

Change the nicde cc the name cf a disk file. 
CHMODE, BENAME, .BENAH 

PU££OSe 

To change the mode or the name of a disk file. 

ysaj.e 

To :;hange mode: 

as library Eubrcutine: 

FAP: TSX CHM0DE,4 
PgE FILNAH 
P«E MOCE 



FCHTRAH: A = CBMODE (FILN AW, MODE) 

HAD: A = 3HM0DE. (FIL»AK, HCDE) 

MODE is fcr temporary, 1 for permanent, 2 for 
read only Rl, 3 for read only R2. (8 1 and R2 
are READ-ONLY, PROTECTED) . 

A will be zero if successful or will contain the 
disk error code if the file cannot be found or 
changed. 

To change nane and/oi mode: 
as core-B write around 

FAP: ISX .B£NAM,4 

OPN FILNAM,,NBUMAH 

To change name: 

as library subroutine: 

HAD: A = RENAME. (FILNAM, NEWKAM) 
FORTRAN: A = RENAME (FILNAM, NEHNAM) 

.RENAM replaces in the current file directory the 
file name specified by FILNAM by the new name 
located at NEWNAM by calling CHFILE. The 

standard supervisor error procedure may be 
followed. 

OPN specifies the mode of NEWNAM. P«E is 

temporary, PON is permanent, PTW is B1, and 
FTH is B2. (Rl and R2 will be treated as 
READ-ONLY, PBOTECTED files in the new system) . 



CTSS EFCGRAMMEfi«S GUIDE Section AG. 3. 01 11/65 2 

SENAME has two tries at ::hanging the name of FILNAM 
to NEW NAM. If the first try fails because a 
file by the name of NESNAM alrealy exists, an 
attempt is made to delete this file with a 
call to the library subroutine DELETE. (if 

the first try fails for any other reason, AC 
will contain the error code froa CHFILE) . If 
the old version of NEWSAM cannot be deleted, 
AC will contain the error code from DELETE. 
When the old file neunam has been deleted, the 
second try at renaming FILNAtt is made. If 

this fails, AC will contain the error code 
from CHFILE. 

If BENAME is successful the old file is given 
the new name and the mode is unchanged{ upon 
return from BENAME, AC will contain zero. If 
RENAME is unsuccessful, AC will contain the 
error code. 

RENAME will not change the name of a linked 
file. If FILNAM is linked, an error code of 
octal aO(dec. 32) is returned in the signed 
AC. 



(END) 



llytC 



I il e n t i f i c a t i o n 

Dalata file from file directory 
DELETE, ERASE, . DLETE, .ERASE 

Purpose 

To delete d file fron a directory- 

Usacje 

To delete a file: 

core-B write around: 

FAP: TSX .DLEIE,U 
P2E FILNAtt 

as library subroutine: 

MAD: EXECUTE DELETE . (FI LMAM) or A = DELETE. (FILNAB) 
FCRTBAN: CALL DELETE (FILMAM) or A = DELETE (FILNAM) 

.DLETE calls the supervisor entry DELFIL. The FILNAM 
is removed from the current fils diirectoLy and 
the tracks are made available for other use. 
Protected, read-only, write-only, or private 
files may not Ice deleted by this routine. Any 
error will invoke the supervisor error 
procedure. 

DELETE calls the supervisor entry DELFIL- If the 

file is linked, a message will be typed asking 
if the file should really be deleted. If a 

•linked* file is deleted, the link and file 
nane still exist in the currant file directory 
but the file to which they point is deleted. 
If the file (whether linked or not) is 
protected, read-only, write-only, or private, 
a nessage will be typed. Only the author »ay 
delete a protected file- 

Upon return, if the file is not deleted the AC 
and A will contain an I/O error code, 
otherwise the AC and A will be zero- 



CTSS 



FPCGRAMMER'3 GUIDE Section AG. 3.02 11/65 2 



TO erase just the name: 

as cote-E write arouad: 

rSX . ERASE, U 
P2E FILNAM 

as library subroatine: 

MAD: EXECJrE EHASE. (PILNAM) or A = ERA SE . (FILNAM) 
FORTHAN:' CALL ERA SE (FI LNAM) ' or A =« ERAS E ( FILHAtt) 

ERASE is now the same as DELETE (.ERASE = .DLETE). 
In the earlier version of CTSS, as a result of 
a call to ERASI, the tracks were net made 
available for ether use and the user's track 
count was not updated until the next time the 
disk was leaded. 



(EHD) 



r-iKcc DDnnD a mm;7d • Q r: urnp <5R!^*-ir>n Ar;.3-01 6/69 1 



LI ^^ V k^> V« ** •-' ■-■ *« 



Identification 

Switch current file directory 
COMFIL, C3MFL, ISSFIL, USRFIL 

P ur£Ose 

To allow the user to SHit::h between his home file directory, 
crommon file directories associated with his problem number, 
or a public file directory. 

Usa<je 

To switch to a coamon file directory: 
As supervisor or library entry: 

CAL N 

rSX COMFIL, t* 

P2E BUSY 



Optiona 1: 

COMFIL TIA =HCOMFIL 

N contains the integer of the common file 
directory desired. Zero is the user's home 
file directory. 

BUSY It is no longer possible for a file directory 
to be "busy** but the calling sequence is 
preserved for compatifcilit j. Control will 

always return to 2,U. 

Unlike the old file system, active files are 
now not reset when a directory switch occurs. 

As library subroutine: 

BAD: COHPL. (N) or EXECUTE CDMFL.(N) 

FORTRAN: CALL COMFL(M) 

To switch to a public file directory: 
As supervisor or librarj entry: 

rSX rSSFIL,4 optional (TIA =HTSSFIL) 

- PAR PROS - 

- PAR PROG - 

- PAR LOC - 

TSSFIL switches the user to the file directory named 
by PttOB PR03. The user is permitted to switch 
into any of the following directories: 



CTSS FFCGRAMMER'S GUIDE SEction AG. 3. 03 6/69 



1) his home file directory 

2) any public file directory 

3) his current directory 

4) (iny cGi^LSon ^.x j.e gd uls pro Dj. esi n u SDer § x j. 
he has common-file privilege 

Any other values for PfiCB and EBOG will result 
in an error. If the third argument is 

supplied, a transfer will be made to LOG; 
otherwise, the supervisor will print an error 
message and place the user in DORMNT status. 

If the arguments PROB and PROG are not 
supplied, the user will be switched to the 
system public file directory, M1416 CMFL04. 
This directory is composed of links to certain 
files in the system file directory which are 
in read-only, protected mods. The record 

guota of the TSSFIL directory is 0, so that 
the user may net create files after a call to 
rsSFIL. 

rSX [JSRFIL,U optional (TIA =HUSRFIL) 

USEFIL restores the user to the directory he was in 
before the call to TSSFIL. If TSSFIL was not 
called, USRFIL does nothing. 

Note: the library entries, TSSFIL and USRFIL, 
may be called from MAD or Fortran programs. 



(BHD) 






Identif icaticn 

Query file status 
FSTAT, .FSTAT 

Purpose 

To obtain the nicde and word count of a specified file. 

Usa^e 

As supervisor or library entry: 

IbX .FSIAT,U optional (TIA =H. FSTAT) 
P2E FILNAM 

As library subroutine: 

MAD: A = FSIAT. (FILNAM) 
FCRTFAN: A= FST AT ( FILN AM) 

.FSTAT If the file is not found, the supervisor disk 
error frocedure is initiated. 

Upon return froni FSTAl, the AC or A will contain zero 
if the file was not found. Otherwise, it will 
contain a word of the form OPN WDCNT. 

OPN is the mode of the file, PSE is temporary, PON 
is peroanent, PTH is B 1, PTH is B2. 

WDCNT (the address and tag) is the word count of the 
file. 



(END) 



Crss FRCdRA HMER'3 GtlTCE Section AR.3-0S Phha 



Identification 

G:it tha name of next file 
GTMAM 

PUC£03e 

IE a program creates an unknown numter of files, assigns 
them sequential primary names, and uses theai in a push down 
list, it is necessary to be able to determine the next 
available primary naite. 3TNAM performs tha search for the 
mxt available name. 

Usaie 

As library subroutine: 

FAP, BAD or FORPHAN 

A = GTNAM. ($bCLASS$) 

GTNAM searches fcr the first file which dees not 
exist in the series of primary names ...00 1 
thru ...999 with secondary name CLASS; then 
tries to delete the following file, if any; 
and returns in A the first BCD primary name 
available in the series. 



(END) 



ri'<^c: cnrrtRBMH PR tq rrriTri* <^ori-ie\n af:-l_Ofi ll/fi=; 



lis B ^i f i cat ion 

Drop files from active status 
.RESET, RESETF 

Puri)Ose 

To remove all user's files in active status from the 
supervisor's list of active files, 

Usaje 

Core-B write around: 

TSX .RESET,4 

.BESET will remove all the user's active files from 
the active status. All files in active write 
status will be lost. All temporary files in 
active read status will be deleted. This call 
will not remove the user's active files from 
the library subroutines' list of active files. 

As supar visor or library entry: 

TSX RESETF,!* optional (TIA =HRBSETF) 

RESETF will remove ail the user's active files from 
the active status. All files in active write 
status will be lost. All temporary files in 
active read status will be deleted. This call 
will not remove the user's active files from 
the library subroutines' list of active files. 



(END) 



C^r-t-irxn ifZ 1 07 1 "? / fi ft 



File status, change name cr mode, or delete 
CHFILE, DELFIL, FSI&IE, STORGE , UPDATE 

With the new I/O system, as with the old, it is possible to 
change the mode or name of a file, to delete a file, or 
query the system about the status of a file. If the entry 
in tha current file directory is a link, these routines 
r^far to the actual file not the link entry. 

Usage 

Change: 

CHFILE. {$CLDNM1$,S0LDNW2$. NEHMOD , SNEWMHU , $NEHNH2$ ) 

0LDNM1 0LCNM2 is the name of the file which is to be 
changed (right adjusted, blank padded). This 
file may not be in active status at the time 
of the change. 

NEWMDD is the desired mode of the file. 

NEWNM1 NEWNM2 is the desired name of the file. 

SEMNMl NEWNM2 may not be the same as OLDNMI 
0LDStt2. To change just the mode, the new name 
must be specified as -0. 

Error codes: 

03. Attempt to change M.F.D. or U.F.D, file 
CU. File not found in U.F.D, 

05. 'LINKED' file not found 

06. Linking depth exceeded. 

07. Attempt to change 'PRIVATE' file of another 
user 

08. Attempt to change • PBCTECTED' file of another 
user 

09. Record gucta overflow 

10. File already exists with name 'MEHNMI HEHNM2' 

11. dachine or System error 

12. File ia active status 



Delete: 



DELFIL. ($ NAME1$,$ KAME2I) 



DELFIL will delete the file NAMEl NAME2 from the file 
directory and the space is immediately 

available for use within the record guct^. 



CTSS FBCGRAMMEB'S GUIDE Section AG. 3. 07 12/66 



Error codes : 

03. File nDt found in U-F.D. 
OU. 'LIMKED' file not found 

05. Linking depth exceeded 

06. File is PROTECTED, PRIVATE, BEAD-ONLY, or 
WBIIE-ONLT. 

C7. Machire or system error 
08. File in active status 

Status: 

FSTATE. {$ NAME1$,$ NAME2$,A(8) 8) 

Upon return, the array A will contain the following 
infotnaticn as integers: 

A(8)= length of file in number of words 

A (7)= MODE of file: MODE is negative and the •0R« 

modes if the O.F.D- entry is a link. 
A (6)= STATUS Df file (I-'*) 
A (5)= DEVICE on which file resiled (1-3) 
A{'»)= Address of next word to be read from file 
A (3)= Address of next word to be written into file 
A(2)= Date and time file was created or last 

modified, format of U.F.D. 
A ( 1) = Date file was last referred to and »AUTHOR» of 

file, fDrmat of O.F.D. 

STATUS is 1 inactive 

2 open for reading 

3 open for writing 

U open for reading and writing 

(N.B. "Open" means "opened by any user", not merely "opened 
by a caller" .) 

DEVICE is 1 Low speed drum 
2 Cisk 



3 lape 



Error codes: 



Si 23 



C3. File not found in O.F.D, 
04. 'LINKED* file not found 
C5. Linking depth exceeded 



STOHGE. (DEVICE, ALLOT, USED) 



STCHGE may be used to determine the number of records 
allotted and used on a particular device_ by 
the files of the current file directory. 






ALLOI and USED are intager variables which, upon 
return, will contain the number of records 
allotted and used, respectively. 



Error codes: 



C3. Illegal DEVICE specified 
OH, Machine or System error 



Current UFD: 



UPDATE. 



UPDATE causes the I/O system to replace the user's 
U.F.D. (FILE) and the track usage table on 
the disk with the up-to-date versions which 
are maintained in core-A. The file system 

does this updating automatically and, 

therefore, UPDATE shouli not be called by the 
user. 

03. Machine or System error 

(END) 



Identification 

Historic File systei Error Procedure 

Purgosa 

•PUa V^itrffirir en ror ui cr>r fl-iffilf fnni-rol rftiitin?» DTovided a 

standard error pracedure as well as a handle by which the 
user may supply his own procedure. 

Usa3.e 

Standard: 

If a disk error occurs and the user has not 
specified an error return, the supervisor will 
type : 

ILLEGAL CALL TO XXXXXX. NO EBRCfi BETUBS SPICIFIEC 

and then call DORMNT so that debugging tools nay 
be used. 

User's option: 

The user may add another argument to the calling 
sequence of any disk supervisor or library entry, 
in which he specifies the location of his error 
routine. If the prefix of this argument is PZE, a 
diagnostic will be printed and control will be 
transferred to the specified location with an 
error cade in the AC. If the prefix 

argument is M«E , the diagnostic will 
printed but otherwise action will be the 
PEE. The error codes are: 

Illegal calling sequence 

Too many active files (.G. 1C) 

User not found in Master File Directory 

Available space on module exhausted 

File nat found 

Allotted track quota exhausted 

The error code of 1, "Illegal calling Sequence" may 
from any of the following error conditions: 

a. Illegal call to the .WRITE routine ; this occurs 
if the call to .WRITE references a file which is 
in active read status, or a file in relative 
read-write status where a relative address is not 
specified, or if a relative address is specified 
for a file not in relative read-writa status or an 
fli mode file in relative read-write status. 

b. Illegal call to the .CLEAR routine; this occurs 
if the call references a file in active read 
status DC relative read-write status. 



of tl 


tie 


not be 


sane < 


iS 


P2E 


1 


P2E 


2 


PZE 


3 


P2E 


U 


P2E 


5 


P2B 


6 


' result 



CTSS PROGRAMMEH'S GUIDE Section AG. 4. 01 Page 



c. Illegal call to the .FILE routine; this occurs if 
the call references a file in activa read status. 

d. Illegal call to the .READK routine; this occurs 
if the call references a file not in active read 
status, or if a relative address is specified for 
a file n3t in relative read-write status. 

3. Illegal call to the .ENDRD routine; this occurs 
if the call references a file in _ neither active 
read nor relative read-write status. 

f. Relative address too large for file; this occurs 
if an attenpt is made to write into a relative 
address greater than the length of the file 
referred to. 

g. File word count zero; this occurs on a call to 
.DUMP with a word count of zero, or a call to 
.FILE where no words have teen written; the disk 
routine is so organized that a file with a zero 
word count oay not exist. 

h. Tried to rename read-only class 2, 

i. Attempt to delete file in read-only mode. 

j. File NAMEl NABE2 is not an active file; this 
occurs if a call to .WRITE, .FILE, .READK, or 
.ENDRD references a file not in active status. 



(EHD) 



mi^r*oitMMC*Dic nn T PI? <z ck ol- -tnn ftf^.U^D? 9/65 1 

f U U VT i.1 n L J 1 ■ 4mI X.\ <^ VJW .^.A^^ w— — — — — -- — -_-_ 



Library disk error procedure 

SETEBH, SNAP, RECOUP 

Pur£Ose 

Th3 library disk subroutines provide a standard error 
pro::edure as well as handles by which the user may provide 
his own error procedure. 

Method 

Tha library disk subroutines use a connon routine which 
maintains an active file table. If an unexpected error 
o=3urs, the offended routine calls SNAP which prints an 
error message and calls RECOUP which in turn calls EXIT. 
EXIT is able by means of the active file table to properly 
CLOSE any active write files and save core so that the user 
miy than use debug facilities. BECCOt and SETEBB are 
provided so that the user may supply his own error 
procadure . 

Usaie 

^ F T F* R R ■ 

MAD: EXECUTE SETERB, ( -RBTUBN- ,- ERROR-) 
FCBIBAN: CALL SETERR (-N- ,-EBRCR-) 
FAP: ISX 3ETEHR,'* 
-P2E BEIUHH- 
-PaE ERHOR- 

SETEBB modifies SNAP so that if SNAP is called, control 
will be transferred according to RETURS without 
disturbing any machine conditions. 

HETUBN is the error return location to which the 
library disk routines should transfer for 
unexpected errors. No message will be printed 
frcB SNAP. 

EBBCB is the location in which the logical 
accumulator will be stored i.e., the error 
code from the disk routine. 

N Should be set by an ASSIGN stateient in 
Fortran programs in order to provide the error 
return . 

It only one argument is provided to SETEBE, it will be used 
as the error return aryument. 

If uo argument is provided to SETERB, the standard error 
procedure will be reinstated. 

Every call to SElSaa supercedes the previous one. 



CTSS EFCGRAMMER«5 GUIDE Section AG. 4.02 9/65 2 

RECOUP: 

CALL REZOUP (ERCODE, rB4,-IND-) 

RECOUP may be supplied by the user if he wishes to 

provide his own procedure. If no user RECOUP 

is provided, the library version of RECOUP 
merely calls EXIT. 

ERCDDE contains the logical AC frcm the offended disk 
routine, or the error code from (lOH) . 

Error codes: 

1 Illegal control character in format 
statement. 

2 Illegal character in data field. 

3 Illegal character encountered in octal input 
data , 

IR 4 (decrement) contains the contents of index 
register U at the time of the call to SMAP. 
It should be used to reset index register 4 
before returning to the I/O routine. 

IND contains the contents of the sense indicators 
at the time of the error in the disk routine. 
This argument is not present in the call from 
(lOH). 

Sense indicators contain (decrement) the return 
location if processiag is to be continued. 



SNAP; 



The library disk subroutines normally supply SNAP 
as the error exit to the supervisor disk routines. 
The call is, therefore, a TRA instead of a ISX and 
the AC contains the disk error code. 

If SNAP has not been modified by SETEBR, it will 
call PBNTEB to print the standard error message, 
then print the following message and call RECOUP. 

XX CALLED SNAP PROfl ABSOXUTE LOC NN . RECOUP 

CALLED. 

XX is the name of the disk routine in which the 
error occurred. 

NN is the absolute octal location of the call to 
SNAP. 



(END) 



C a r^4- inn \ (1 Ik HI Ou nc 



End-of-file procedure for library subroutines 
EOFXIT, SETECF, W RDCNr 

Purpose 

E3FXIT provides a conifflcn end-of-file procedure for all 

library subroutines which read tape or disk files. The user 

is supplied a handle whereby he may supply his own 
ani-of-file procedure if he wishes. 

Method 

Iha standard library procedure is to call ECFXir upon 
aucountering an end-of-file. EOFXIT prints a message and 
calls EXIT. The user may call SETECF before reading and 
thus modify EOFXII to return to the user's eof procedure 
rather than calling EXIT. 

Usa^e 

EDFXIT: 

Tha library routines call EOFXIT by: 

rSX EOFXIT, 4 
P2E FILNAM 

EOFXIT prints the message "END OF FILE BEADING NAMEl 
NAME2". It then calls EXIT, unless it has been 
modified by SEIEOF. 

SETECF: 

FAF: rsX SEIEOF, 4 

-P2E EOF- 

-P8E FI1NH1- 

-P2E FILNM2- 

BAD: EXECUTE SETEOF. {-EO F-, -FILNM 1- , -FILNM2- ) 
FORTRAN: CALL SETEOF (-N-, -FIIMM1-, -FILNH2-) 

SETEOF will modify EOFXIT to return to location EOF 
in the user's program if an end-of-file is 
encountered. If there are no arguments, the 
standard ecf procedure is restored. Each call 
to SETEOF supercedes any previous call. 

ECF is the location of the user's end-of-file 
procedure. 

N must be set by an ASSIGN statement in Fortran 



CTSS EPCr,RAMMER»3 GUIDE 



Section AG.U.03 



Page 



i.e. ASSIGN 1 TO N 
GO 10 N, (1 ,2) 
i ASSIGN 2 10 N 



2 90 f pcoG©dure 
FILNM 1,FILNM2 are 



the lo:rations in which NAMEI and 
NAME2, cespectively, will te stored by EOFXIT. 
If FILNI12 is missing, the logical tape number 
will be stored in FILNM1. If both FILNMI and 
FILNK2 are missing, a single argument will be 
assumed to be FOF or N . 



WKDCNT: 



FAP: ISX KRD3MT,4 or TSX WHDChlT,4 

PZE LOG STjat LOG 



MAD or FORIBAN: CALL WRDGNT (LCG) 

WRDCNT can be called only after an end of file was 
encountered by BREAD or VREAD. 

LCG will contain the nunber of words transmitted by 
BREAD as a right adjusted integer. If WRDCNT is 
called by a FOBIRAS progran, the integer will be 
in the decrement of LOG. 



(END) 






I^sntificaticn 

Terminal procedure. 

EXIT, EXITM, CLKOUl, ENDJOB, DUMP, PDUMF 

Pur£osa 

To provide a coumon routine for the normal logical 
tarmination of all prDgrams. The option is provided for 
placing the program in COBMNT status so that post mortem 
debugging may be used. 

Usdis 

EXIT, CLKDDT and END JOB are synonomous. 



EXECUTE EXII. 
EXECUTE CLKOUT, 
EXECUTE END JOB. 
EtiB OF PROGBAH 
END OP FOHCIIOS 

The message "EXIT CALLED. FH MAY BE TAKEN" will be 
printed. EXIT calls CLOUT to close all active 
files. If no library routines calling the file 
system exist in the program, a dummy CLOUT will be 
loaded from the library with EXIT. 



EX ECU IE DO HP. 
EXECUTE PDUMP. 

The exit message will be printed with the name 
DUMP or PDUHP substitued for EXIT. 

Any of the above calls cause all active files as 
defined by library subroutines to be properly 
closed and then a transfer to DORHMT. 



EXECUTE EXITM. 

The message "EXITM CALLED. GOODBYE" will be 
printed; active files will not be closed; 
transfer will be to DEAD. 



(END) 



*^sct.''Gli AG 4.05 Pd'^s 



Identif ic ation 

Error Exit ftcra Math Library Routines 
LDUME 

Purpose 

LDUMP is d subprcgram to which some library math routines 
transfar upon encountering an error. The version of LDUMP 
which is in the library is a call to EXIT, but the user may 
provide his own version of LDUMP to provide recovery action, 

ysa3.e 

The calling sequence to LDUMP which is used by the math 
routines is 

FAI: 



CLA 


ARGI 


LDQ 


ARG2 


ISX 


LCOMP, 


P«E 


NAME 


IRA 


IN 


IRA 


OUT 


LXD 


IRU, H 


IRA 


0,4 


LXE 


IR4, 4 


TRA 


1,4 



TC REPEAT BCUTINE 
TO EXIT FROM ROUTINE 



IN 

cur 



ARGI contains the first argument to the math 
library subprogram. 

ARG2 contains the second argument, if any, to the 
math library routine. 

NAME contains the BCD name of the offending 
routine. 

IN is the return of 2,4 which the programmer 
should use if he is writing his own LDUMP and 
wishes tc repeat the offended subprogram 
after he has corrected the error. 

CUT is the return of 3,4 which tb« prcgrammec 
should use if he wishes to return from the 
offended routine without repeating its 
calcula ticns. 



(END) 






identification 

Current I/C systera error procedures 
IDDIAG, FEBRTN, PRNTEB , PRDIAG 

Purpose 

Thare are three different ways that errors from the I/O 
system can be handled: First, if the user does nothing, the 
I/O system will print a standard message and call DORMNI, 
Second, the user may call FERRTN to establish a single 
ganaral error return for all I/O system errors. Third, 
avary call to the I/O system will accept two additional 
arguments which specify an error return and a location into 
whi::h the error code will be stored. These arguments apply 
only to the call in which they appear; that is, if a general 
return has been specified, it will be overridden for and 
only for calls in which error return argumants occur. The 
subroutines included in the I/O (or file) system are those 
listed in Section AD. 2. 

Usacfe 

1. Standard: 

If an error is encountered by the I/O system 
and the user has not supplied an error return 
via FERRTN or via the optional additional 
arguments to the I/O system subroutine call, 
the I/O system will type a standard message 
and call DOHMm so that debugging tools may be 
used. The typed message will include the 
information available from lODIAG. Open files 
will not be closed. 

2. Single return: 

MAD: OLDiRH = FERRTH . (ERRL3C) 

FAP: rsX FEBRTN, 4 

P«E ERRLOC (note P2E, not TXH) 

SLW OLDER 

FERRTN sets the standard I/O system error return to 
be location ERRLOC. 

EBBLCC is the location to which control should be 
transferred if the I/C system detects an 
error. Upon entry to ERRLOC, index register 4 
will contain the value set by the call to the 
I/O system that caused the error to be 
detected. To continue execution by ignoring 
the I/O call, transfer to 1 , U. To continue 
executiDn ty repeating the I/O call, transfer 



CTSS PHOGRAMMEH'S :;iJTDE Saction AG,U.06 12/69 



to 0, U. 

If EfiRLOC is zero, the standard I/C error 
procedure will be reinstated- 

CLDEBR Upon return frcm FERRTN, the AC will contain 
the previous setting of the system error 
return. Each call to FERRIN supercedes any 
previous call. 

3. Individual returns: 

Each call to the I/C system entries will 
accept two additional arguiB€nts at the end of 
the call. The first is the location to which 
control is to fce transferred if an error is 
encountered by the I/C system. The second, if 
specified, is the location into which the 
error code will be placed by the I/O system. 

4. Diagnostic infer nation: 

lODIAG. (A (7) ...7) 

lODIAG may be called to obtain specific information 
about the I/O system error- Upon return, the 
array A will contain the following 
information : 

A (7)= Location of call causing the error 
A (6)= B3D name of entry resulting in error 
A (5) = Error code 

A (4)= Input/Output error code (1-7) 
A(3)= NAME1 of file involved in error 
A (2)= NAME2 of file involved in error 
A(1)= Location of file system where error was 
found (of no use to user) 

5- Printing of diagnostic: 

A. subroutine: PRNTER. (-M ASK-, -FCN .-) 

B. Command: PRNTER -MASK- 

PRNTER The subroutine PRNTEB may be called after an 
error in the I/O system in order to print the 
inforaation that is availatls from I0DIA3. In 
other words, PRNTEB is a routine which calls 
ICCIAG and formats and prints the information. 
For usage cf the command, see AH. 11.01. 

MASK If specified, bits in KASK call for the 
printing of different parts of the output 



w X -J o r n u ^J n n L'j I'i ij n 



message. Ihe message parts and their 

corresponding iits are: 

200 the word • EHROR' 

100 numeric; error code 

040 diagnostic 

02 file na IBS 

10 routine name 

OOU location called from 
002 file system location 

001 carriage return 

If MASK equals 2ero or is not given, default 
MASK of 375 is used. 

FCK . If a function name is given, then instead of 
printing, PRNTfR calls FCN . by 

EXECOrE FCN. (BUFF,Z) 

where Z is the highest subscript of the 
array BUFF, f nd BUFF(Z).,. EUFF(1) 
contains the (BCD) message which would 
otherhise have been printed. The called 
function could then, for example, write 
the error message into a file and 
continue execution. 

For the benefit of FAE subroutines, the 
calling sequence is in fact 

rsx Fcs, 1 

TXH B,,«z» 

IXH =Z 

where z = message size, B ~ BES location of 
message buffer. 

C. Subroutine: PRDI&G. 

PRDIAG will format and print the information supplied 
by lODIAG. Ho descriptive diagnostic is 

provided hy PRDIAG; it is offered mainly for 
those situations where core space is at a 

premiuB. 

1EE2£ £5^es 

Standard error codes: 

There are a feh standard error codes which may 
be returned from any of the I/C system calls. 



CTSS PHOGttAMMEK '3 3UIDE Section hG.^.06 12/69 4 



00 1. Illegal calling sequence oc Protection 

violation 
002. Unauthorized use of priveleged call 
1GC. Error reading or writing 'J.F. D. or M, F. E. 
10 1. U. F. D. or M.F.D. not found. Machine error 

Input/cutput error codes: 

In many of the write-ups of the calls to the 
I/O system, one of the possible error codes is 
labeled Input/Output error. For the laost part 
these errors are detected only after the I/O 
has been completed and will, therefore, be 
reported one call late. The actual error may 
be diagnosed by the value of A (4 ) after a call 
to lODlAG. 

1. Parity error reading or writing file 

2. Fatal error reading or writing file, cannot 
continue 

3. Available space exhausted on this device 
14. lape file not mounted or not available 

5. Illegal operation on this device 

6. Physical end of tape sensed while writing 

or 
Logical End of Tape of tape passed trying to 
open a file 

or 
End of tape file encountered unexpectedly. 



(END) 



TSX 


.PUNCH, 4 


TSX 


. PNCHL,4 


TSX 


.TAPWR,^ 


TSX 


(SCH) ,4 


TSX 


{STH),U 



c:Q^*-;r.n4r:^ni 4/fiS 1 



Ijantif ication 

Write BCD pseudc tape with format ::onversion 
.PUNCH, .PNCHL, .lAPWR, (SCH), (STH ) , (STHM) 

Pur 22 S3 

The MAD and FOHiaAN BCD tape and punch statements are 
:;o«ipilaa as calling se.^uences to litrary subroutines. These 
subroutines then simulate the writing of tape files by 
:;alling the library disk routines. 

Usaje 

MAD: PUNCH FOKMAT FMT, LIST FAP: 

EUHCH ONLINE FORMAT FMT, LIST 
WRITE BCD TAPE N, FMT, LIST 

FORTRAN: PUNCH FMT, LIST 

WRITE OUTPUT TAPE N, FMT, LIST 

The FAP calling sequence compiled for MAD programs is of the 
form : 

TSX .PUNCH ,U or TSX .TAFWR,U 

STR N 

SIR FHT,,DIR or STR SYHTB, DI R, FMT 

OPS 

SIR LlSr,,ENDLST 

OPS 

SIR 

Tha PAP calling seguence compiled for FORTRAN prograns is of 
the form: 

CAL N 

TSX (SIH) ,4 

PZE FMT,,SHITCH 

OPS 

LDQ LIST 

STR SWl 

OPS 

TSX (FIL) ,4 

.PUNCH, .PSCHL, aod (SCH) create or append to a pseudo 
tape line-marked file named .TAPE. 3 

.TAPWR, (STH), and (STHM) create or append to a pseudo 
tape line- narked file named .TAPE, 'n • 

S contains the number of the psaudo tape to be 
used (decrement for FORTRAK) 

CES isay be indexing instructions. 



CTSS PROGRAMMER'S 3UIDE 



Section AG. 5-01 



B/65 



SWITCH is zero if the format is storei backwards and 
non-zera if the foraiat is stored forward. 

L 1ST, , ESDLS'I are for standard list processin'j (see 
MOVE 1, 2, 3). 



DIP If zero, the format is stored forward, 
one, the fcraat is stored backward. 



If 



SWI if zerc with I format, the value is taken from 
the decrement of location LIST. If ncn zero 
with I format, the value is taken from the 
address of location LIST. 

SYMTB in a BAD call, refers to the start (bottom) of 
symbol table for this routine. 

(FIL) provides hlank padding; with (SCH) to 80 
characters and with (STH) to 132 characters. 

Disk ertors will evoke the standard library 
disk error procedure and format errors call 
RECOUP. 



(END) 



Cti^Vinn hCZ ^ H'J Q/A^ 1 



I^S£tif icaticn 

R^ai BCD pseudD tape with format conversicn 
.TAPKD, (TSH), (rSHM) 

Purjjpse 

MAD and FORTRAN BCD tape read statements compile as calling 
sequences to libtaty subroutines whi-h in turn call the 
library disk routines to read pseudo tape files from disk. 



Usaie 

MAD: READ BCD TAPE N, FMT, ilST 
FAF: rSX .rAPRE,4 
SIR N 

SIR FHT,,DIR or STR SYM TB , DI8 , FMT 
OPS 

STR LISr,,lNDLST 
OPS 
SIR 

FORTRAN: READ INPUT TAPE N, FMT, LIST 

FAP: CAL N 

TSX (TSH) ,M 

P«E FMT,, SWITCH 

OPS 

SIR 

SIQ LIST 

OPS 

rSX {RTN),U 

(TSH) and (TSHM) are synonymous. 

(TSH), (TSHM), and .TAPRD read records from the disk 
file .lAPB. n according to the format and 
list. The file may be line- marked or fixed 
length of 1U words. 

M contains the tape number (decrement for 
(ISH)) . 

OPS nay be indexing isstr*ictions. 

SWITCH of non-zero indicates the format is stored 
forward. 

DIR If zero, the format is stored forward. If 

one, the format is stored backward. 

LIST,,ENDLST are standard LIST processing (see HOVFI). 



CTSS ERCGRAMCiKR'S GUIDE 



Section AG, 5.02 9/65 2 



SYMTE in a MAD call refers to the start (bottom) of 
the symbol table for this routine. 



/pwn^ 



V« i. h^ ^ £ u v> vj 1.1 n 1.J (.J -1^ «.» ^ v^w .k A^ &^ 



Q o*-*- i nn a r: - S - n ^ 



P;i no 1 



li§.Iltif icati cn 

Ridd ana write binary pseado tape. 
(STb), (TSB), (WLR), (HLR) 

Purjjose 

FORTRAN programs which use binary tape statements may be 
compiled as background and run as foreground since the 
library subroutines will simulate the tapes as disk files. 

5 i s trie t ion s 

The subroutine .RBIM called by binary tape statements in a 
MAD or MADTRAH translated program is not currently available 
in the library. 



Usacje 



FORTRAN: WRIIE TAPE j!l, LIST 
FAP: CAL N 

rSX (STB,),** 

OPS 

LCQ LIST 

SIR 

OPS 

rSX (WLR),U 

FORTRAN: READ TAPE N, LIST 
FAP: CAL N 

rSX (TSBS,4 

OPS 

STR 

SIQ LIST 

OPS 

TSX (HLR) ,U 

N contains in the decrement the number of pseudo 
tape. 

CES may be indexing instructions. 

(TSB) and (STB) rea<3 or write th€ number of words 
specified in the LIST from the pseudo tape 
file .TAPE, 'n* by calling BREAD or BWRITE. 



(END) 



rnnnD »MM wo • c; nnmp Section AG-5.0U Paqe 1 



K ^1 V^ v^ ^ 



Identification 

Pseudo tapes; backspace, write end of file, rewind 
.BSF, .BSR, .EFI, .RWT, (BST), (EFT), (PWT) 

Purgosa 

MAD and FUHTRAN fiograms which refer to tapes are assigned 
aisk space which is used to simulate the tape. These pseudo 
tiD^ files may then be referred to by the standard MAD and 
FORTRAN statements which compile as calling sequences to the 
appropriate library subroutines. These library subroutines 
then simulate the functions as far as possible on the pseudo 
tipa files. 

ilStrictions 

The disk pseudo tape files may not be backspaced and 
therefore the backspacing subroutines do nothing but print a 
console nessage "BACKSPACE TAPE IGNORED". 



Usa^e 



WAD: BACKSPACE fILl OF TAPE H 

BACKSPACE RECOBD OF TAPE N 
ENE OF FILE TAPE N 
REWIHD TAPE N 

MADTHN : BACKSPACE N 
EHDFILE N 
REMIND N 

FAP: ISX .BSF, 4 or TSX .EFT,U or TSX ,aWT,U 
rXH M 

FOHTBAK: BACKSPACE H 
END FILE M 
BEHIND N 

FAP: CAL S CAL N CAL N 

TSX (BST) ,U TSX (EFT) ,4 TSX (BWT),U 

.BSF and «BSB are fynonymous and simply transfer 
to (BST). 

(BST) does nathing tut print the console message 
"BACKSPACE TAPE 13 NOBED" and return. 

.EFT and (EFI) close the psaudo tape file .TAPE. 
•n • by calling the library subroutine FILE. 



CTSS PROGRAMMER'S GUIDE Section AG.5-0U Page 2 



BWT and (RWr) close the pseudo tape file .TAPE. 
'n' if it is active. 



{u au I 



n tirm? cior-f-ion Ar;.S.Q'j 12/69 1 



Identif icaticn 

Us3 of tapes in fDcegcound 

M3UNT, UMOUNT, VBKIFY, LABEL, TAPFIL 

Purgosa 

Tip=»s may be read aad written by foreground users either 
with or without a console (FIB). The major difference 

batween the user-I/0 system interface for disks and tapes is 
that messages must be relayed to the machine operator to 
mount and unmount certain tape reels. Otherwise the calls 
are the same calls as described for the new I/C system. 

SS§tricticns 

Dsars wishing to use tapes must have an 

administrative-allotted tape quota. Unless otherwise 

sp3::ified (by user messages to the operator) reels will be 
mounted with write rings. 

Usaje 

Mount: 

MOUMl. (-CHAN- , UNIT, HESSAG { N) . . . N) 

HOUHT must be used to direct the I/O system to mount 
a reel of tape on the unit to be subsequently 
referred tc as UNIT. 

CHAN specifies which channel is desired. »1« 

specifies channel A; •2' specifies channel B; 
•0* or '-0' indicates "no preference". 

UNIT specifies a logical unit number (0 through 
32767) by which the user will refer to this 
reel in other calls. 

HESSAG is the BCD message which will be printed for 
the operator in conjunction with the I/O 
system*3 mounting instructions. The message 
should contain information about "file 
protection" (write ring or no write ring) and 
reel identification. It should be stored 

"forwards" in memory; that is, the first word 
of the message should be in the 

highest- subscripted location of a MAD array. 
(This i3 not the order which HAD' s VECTOB 
VALUE'S statement normally furnishes, and it 
must be provided for.) 



CrS5 PHOGfiAMMKR '5 GUIDE Section AG. 5.05 12/69 2 



N is the nuafcer of machine words in the luessage 
(N.LE.2C) . 

3rroL codes : 

03. So tape unit availatle on specified channel. 

04. Tape file already exists. 



Unmount: 



IMOUNT. (UNIT, MESS AG {N)... N) 



UMOUNT is used tc direc;t the I/O system to dismount 
a tape and free the corresponding tape drive 
for other use. 

UNIT is the logical unit number as defined by 
MOUNr . 

MESSAG is the ECE message which will be printed for 
the operator along with the I/O system 
unmounting message- It should include 
information about what to do with the reel. 
(See discussion under MCUKT. ) 

N is the number of machine words of HESS AG 
(N. LE. 20) , 

error cede: 

03. lape file in use. 

Labeling: LABEL. (UNIT, LABL (N) ...N) 

LABEI must be used to write a labsl on a new tape 
before it is opened for writing. 

UNII has previously been defined by a call to 
MOUNT. 

LABL is the unigue label for this reel which 
provides identif ica tioa and verification by 
the user. (See discussion of array order 
under MOUNT.) 

N is the length cf LABL (N.LE.4) , 
Error codes: 

03. lape file does not exist. 

04. Machine error or bad status. 



CTSS EFCGHAMMER»5 GUIDE Section AG. 5. 05 12/69 



C5. Haunt failed - illegal operation 

(key code 1 1) * 
06. Mount failed - operations difficulties 

(key code 12) . 



Label vecif icaticn: 



vij cvi c i. . ( u n-L a. I u&D L \ a) . , . a} 



VERIFY roust be called before opening a tape file for 
reading in order to check the lABL on the reel 
iBOunted on UNIT. This insures that the 

operator has mounted the correct reel. The 

file may not be opened until a correct 
verification has been made. 

N is the length of LABL (N.LE.4). 
Error codes : 

03. Tape file does not exist. 
OU. Machine error or bad status- 
OS. Maunt failed - illegal operation 

(key cede 1 1) . 
C6. Mount failed - operations difficulties 

(Key code 12) . 
C7. Labels do not match. 



IAPFIL.($ NABE1$,$ NAME2$, UNIT, FILENO) 

TAPFIL must be called to create an entry for the file 
in the U. F. D. When a tape file is created, 
its name, unit number, and file number are 
entered in the U.F-D. The file may then and 
later be OPENed for reading on the same UNIT 
number without a call to TAEFIL. If a tape 
file was created under a different file 
directory, TAPFIL may be used to enter it in 
the current file directory. If a tape file 
was created on one UNIT and is to be read on a 
different unit, it must be DELFILed from the 
U.F.D- aEd then reentered with the new UNIT 
number by a call to TAPFIL. Any nuBber of 

files may exist on one reel. There is a 

restriction of one reel per file. 

FILENO is a sequence number (integer or integer 
variable) used to specify i«hich file on the 
reel will be referred to as NAKE1 SAWE2. If a 
user wishes to append a file to a reel, FILENO 
must be "0" or "-O". When the file is OPENed, 
the file system will assign the proper FILENO. 



CTSS PHOGRAMMliR • S 3UIDE Section AG. 5. 05 12/69 



itvor codes: 

03. File (ilceady exists. 

04. iidchine ci. i>ysteHi eiEot. 

05. User has no tape ^aota. 

A3 Ji tional_Inf Dcmation 

While the calls to the file system for tape usage may look 
like other file system calls, there are some differences 
batwean taps and disk/drum usage. The salient ones are 

listed here. 

Mount-tape requests are not queued. Thus before any MOUNT 
rsyuBSt is considered, the tape operator uust have complied 
with any previous MOUNI request. Calls to MCUNT will result 
in "Tapa-wait" status if another mount is already pending. 
Calls to LABEL or VERIFY when the tape in question is not 
yit mounted (mount pending) also result in tapa-wait status. 

It for some reason (e.g., no tape drive available) a 
tipa-mount cannot be performed, the user is informed via an 
error return when he tries to LABEL/VERIFY. Since certain 
tiblas are initialized during the mount process, these must 
always be cleared - even when the MOUNT does not succeed. 
Tha claaring occurs the first time LABEL or VERIFY, is 
called if the MOUNT did not succeed. If the user changes 
his mind and does not call LABEL or VERIFY aftar requesting 
a MOUNT, he then must call UMOUNT. UMOUNT is automatically 
::illed during LOGOUT, 

Should a user Quit after a flOUNT request but before the 

required call to UMOUNT (a bad practi::a) , a tape drive will 

bi usalassly assigned. The tape operator can remedy this 

difficulty by depressing a certain set of console keys. The 
ti pa will then be dismounted automat i::a lly. 

A tapa file must be opened either for reading or for 
writing, not for both; record numbers must be consecutive 
during reading or writing. Attempts to rewrite a tape file 
will rasult in an error. When the physical end of tape is 
reached, the file being written must be closed. Moreover, 

tha racord being written is not retrievatle from the tape. 
Consequently, the user roust have the tapa unloaded (call 
UMOUNT) and a fresh tape mounted (calls tc MCUNT and LABEL). 
The writing can then be resumed in a new file by TAPFILing, 
OPENing the new file and then writing that last record 
again. Ehysical records on tape are in binary mode and are 
433 (decimal) words long (except the last record of a file, 
whicrh may be shorter). The first word contains the record 
number and, for the last record, tha word count of the 
racord. 



rvcKt DPncB A MMPft t c; rznmp 



tia'- ¥i nr\ hCZ ^ H^ 



1 9/f,U 



Once a tape label has been successfully created or verified, 
subsayuant calls to VERIFY or LABEL are ignored. This is an 
outgrowth of twc provisions. First, it seemed a good idea 
to allow rapid successive calls to VERIFY in case the user 
winted to search a list of label candidates. Second, to 

expedite file retrieval performed by the operations staff, 
it was necessary to allow superfluous calls to VEfiIFY, once 
a tape had been successfully verified. 



Tape usage is not multi- programmed . Thus 
only whan his program is running in core 
situation is not as bad as it could be 
performed with interrupts) , it obviously 

inherent simplification in our first effort 
tripas as foreground I/O devices. 

Format of Tapes 

BTL (header label) 

End of File mark 

Diti File 1 

End of File mark 

EOFL (end cf file label) 

End of File cark 

Bi'L (header) 

End of File 

Data File 2 



a user spins tape 

B. While this 

(tape I/O is 

represents an 

to incorporate 



Data File n 

End of File neark 

EOFL 

End of File nark 

E3LTL (end cf logical tape label) 

End of File mark 



CTSS FECGHAKMER'd GUIDE Section AG. 5.05 12/69 6 

Fcrtnat of BTL 
WordlsL ^oj]t§I}i§ Djscriiition 

1 3Ebb60 Words 1-2 coastitute 

2 ObEPLh Beginning of Tape label 

3 MITHA3 
U 000000 

5 xuxxxx File number on 

t A nia (in h ina r v^ 

b 000000 

J xxxxxx Date file created 

(file system format) 
8 xxxxxx Fumber of days file 

is to be retained 
(usually . . . 999) 
9-10 XX. ..X File name 

11-m XX.. .X User supplied label 

The only information currently read by Tapa Strategy on a 
praviously created tape file is words 1, 2 and 11-14. The 
rest may be a f propria ted. 

Format of ELTL 

1 bEOLTt 

2- 1U 00... 

Format of EOFL 

1 bbEOffc 

2 Number of records in data file (biaary 

integer) 

3- 14 CCOOOO 

Format of Data_File_i 
Fila i consists of U33-word records where 

yord 1 (Address of first word) = 

number of the record within 
this file. 

(Eecrement of first word) = 
unless this is the last record 
of the file. Then it equals the 
number of words in this last rec- 
ord excluding word 1. 

words 2-433 User supplied data. 

(END) 



r'TQC oonnua MMP» « <c '::nrnp tJa-^-ioTi ac f> fl 1 19/AQ 



Program status 

DEAD, DOBMNT, GETILC, FNEIN 

Pur£Ose 

To remove a program from active status and plase it in dead 
or iormant status and to be able to know the location of the 
last call to DOBMNT. 

Usaa^e 

DEAD: as supervisor cr library entry: 

TSX DEAD,U optional (TIA =HDEAD) 

DEAD returns control to the supervisor and places 
the user in dead status. Machine conditions 
are not saved and oemory bound is set to zero. 

D3RMNT: as supervisor or library entry: 

rsX DORMNr,a optional (TIA ^HDORMNT) 

DOFMNT returns control to the supervisor and places 
the user in doriDant status. Hachine 

conditi3ns, status, and meniory bound are 
saved. If the START coamand is issued, control 
returns to 1,4. If a new program is read in, 
the machine conditions, status, and memory 
bound are overwritten. 

3KTILC: as supervisor entry: 

rSX GETILC,4 (TIA =HGETILC) 

Upon return, the AC will contain the value of 
the instruction location counter at the time 
when the user last entered doEmant status. 

FNRTN: as supervisor entry: 

rSX FNRTN, U (TIA =HFNRTN) 

FNRTN returns the user to dormant status and resets 
the user's instruction location counter to the 
value it had when he last entered dormant. 

B§.^trictions 

DEAD, DORMNT and PNKTN result in an automatic logout if 

cilled from FIB. 



CTSS PROGRAMMER'S GUIDE 



Section AG. 6. 01 



12/69 



Db'AD, DORMNI and FNRIN may result in the execution of a 
command (subsystem), depending on the settings of the user's 
subsysteir status wcrds and options. Refer to sections 
a;]. 8. 05 and AH. 10.03 for details. 



(END) 



Qor-l-inn ha f, 'J 1?/^Q 



Iis[lli.£.i£sLii.2D. 

Interrupt execution for specified time 
SLEEP, WAIT 

Purpose 

Allow a user prograin to place itself in dormant status, 
input-wait status, or timer-wait status, and be restarted 
automatically aftet a specified time. 

Usaie 

Periodic dormancy: 

As a supervisor ar library entry 

CAL =n 

TSX SLEEP, 4 (TIA =HSLEEP) 

The program is placed in dormant status, and is 
restored to working status after 'n • seconds have 
passed . 

.I'nsrdl fatal : 

As a supervisor or library entry 

WAIT. (MODE, H) 

TSX WAI1,U (TIA =HWAIT) 

fAB MODE 

PAR N 

• • • 

N PZE •n* 

The program is placed in a waiting status as specified 
by MODE, and will be restarted after • n« seconds have 
passed. (If *n» is 0, it will not be restarted.) MODE 
is interpreted as follows: 

- Timer-wait status: the program will be restarted 

after 'n* seconds. So commands are accepted. 
Input lines are saved; the program is not 
restarted when input lines arrive. 

1 - Input-wait status: the program will be restarted 

after 'n* seconds have elapsed or when an input 

line is completed. If 'n' is zero, the program 

will be restarted only when an input line is 
completed. 



CrsS PbiOGa AMMER'S GUIDE 



Section AG. 6. 02 



12/69 



Dormant status: the pro>grd[ti hill be restarted 
after 'n» seconds. An input line while dormant 
is interpreted as a commanl. This mode is 



(END) 



<^ Off inn ac.h-O^ Paap 



I il e n t i f i ca t i c n 

Iat3crupt levels 
GSTbRK, SETBRK, SAVBRK 

Purpose 

In ordai: to allow a pcogcam to te interrupted from the 
console but continue running in some other section, programs 
may ba organized to run on different interrupt levels. 

B S.S trie t ion s 

Command level is 0. Levels may be dropped to the maximum 
dapth ot 3. 

Method 

Command level and a program initially placed in working 
status ara at interrupt level O. A program may drop the 
interrupt level and set the entry point for each level. 
Dutinj execution, the level may be raised either by a 
pLojram call to the supervisor or by the user sending the 
iritirrunt signal. The interrupt signal causes the interrupt 
level to be raised by 1 and control to be transferred to the 
2ntry point previously specified by the program. 

An interrupt at level will be ignored, (i.e., an interrupt 
cinnot be used to QUIT). Each interrupt will cause the 
supervisor tc print INl.n. where n is the level to which 
control is to be transferred. 

Usa^e 

SETBBK: 

as supervisor or library entry: 

TSX SEiaRK,U optional (TI A =HSEIERK) 

P2E 'loC 

SEIBRK sets the interrupt entry point for the current 
level to the value of loc and drops the 
interrupt level by 1. 

SAVBRK: 

as supervisor or library entry: 

rSX SAVBRK.U optional (TIA =HSAVBRK) 

SAVBBK raises the interrupt level by 1 and returns in 
the AC the entry point corresponding to the 
level just entered. If SAVBRK is called 

within level 0, the AC will be zero. 



CTSS EBCGRAMMliR*5 GUIDE 



Section AG. 6.0 3 



Page 2 



GETBHK: 

as suparvisor ar libcary entry: 



nw 1 u u V n 



optional |T 



— ^1 \J L. i. t^ i.\ k\ / 



Upcn return, the AC will contain the value of 
the instruction location counter at the time 
the user last "interrupted". 



(END) 



ISnr-li-i r^n « f? (^ 0(1 



D a ^1 A 



Storage Kap 
STOMAP 



Pur^osa 

To print a storage map giving the entry names and locations 
ot all subprograms in core B. 

Usag^e 

As library subroutine: 

rsx srpMAP,a 

The subprogram origin and the entry names and 
locatioQS will be printed for all subprograms 
in core-B. 



(END) 






IlgD-tifi cation 

Floating Point Trap 
.SETUP, (FPT), (EPIM), (LFTM) 

Purpose 

To provide a means of initializing for, interpreting, 
racovaring from, or flushing the program because of 
floating-point overflow or underflow. 

M3thod 

Whan the 7094 is operating in floating-point trap mode, a 
floating point operation which causes overflow or underflow 
will also cause a machine trap. The subroutine (FPl) will 
interpret the trap and take appropriate action. some 
initialization must be done before the trap occurs to enable 
(FPT) to interpret the traps. .SETUP and (EFTM) are used in 
tha initialization. 

ysag.e 

Mdd and Fortran both automatically compile a calling 
saquenca to .SETUP at the beginning of each main program. It 
nped be executed only once per program. 

TSX . SETUP, U 

The multiple tag mode (3 index mode) is 

entered. Location 8 is set to TTR (FPT). The 

floating- point trap mode is established by a 
call to (EFrn). 

A floating-point underflow will cause the 
execution cf the TTR (FPT) which will then 
zero the offending register and return control 
to the instruction following the offending 
floating point instruction. 

A floating-point overflow will cause the 
execution of the TTR (FPT) which will then 
print a message on-line giving absolute and 
relative locations of the offending 

floating-point instruction with the name of 
the subprogram and the machine spill cede. 
(FEI) then calls ERROR which prints a back 
trace of the subprograms previously called, if 
possible, and then calls EXIT. 



CTSS FPCGFAMMER^S GllCf Section AG. 6. 05 Paye 



(LiFTW) and (LFTM) : 

as superviscr or librarj entries: 

TSX (LFTM) ,4 optional (TIA =H (LFTM) ) 

(EFTM) enters floating-point trapping mode with 

trapping mode simulated in core B 

(LFTM) leaves the floating-point trapping mode. 

N. B. The LOAD command enters the multiple tag mode 
before completion. Consequently, a program 
loaded with the relocatable loader will be 
automatically initiated in 3 tag mode. 



(END) 



CTSS PROGRAMMPH • 5 ^niDE Saction AG. 6. 05 9 "f^ 1 

L^^nt if icaticn 

Memory allotment 

GETMEM, SETMEM, GMEM, SMEM, EXMEM 

Pur£osa 

To provide a way of determining or axpaniing the current 
aiaoiory allotment. 

Method 

At load titce the aiemory allotment is set by the number of 
words raguired by the program. Memory protection, however, 
can only be set in blocks of 256 words and is therefore set 
to tha next highest block of 256. If, during execution, the 
user wishes to change his memory allotment and/or 
protection, SETMEM may be called. 

Restrictions 

Since memory protection is set in blocks of 256 words, it is 
possible that a program may store information beyond the 
tnimory allotment bound without causing a protection 
violation. However, swapping is done by memory allotment 
rither than memory protection, so that information thus 
stored is lost during swapping. 

Usag[e 

As supervisor or library entries: 

TSX GE1MEM,4 optional (TIA =HGETMEM) 

CLA =«n' 

rSX SETMEM, a optional (TIA =HSETWEM) 

GETMEM returns in the address portion of the AC the 
current menory allotment. 

SETMEM sets the memory allotment to the value of n 
(low order 15 bits). If n is (77777)8, all of 
memory is allotted, including location 
(7777?) 8. 

As library subroutines: 
MAD or FOBTBAN: 

A = GMEM. (I) 
A = SMEM. (J) 

FAP: rsX SMEM, 4 TSX SMEM,U 

PZE I P-ZE J 

S'lO A STO A 



CTSS PSOGRAMMER'3 GUIDE Section AG. 6. 06 9/65 



A and I Upcn return, will contain an integer giving 
the current memory bound. 

J contains an integer giving the tnemory bound 
desired. 

GMEM returns to the caller the current value of the 
memory bound. 

SMEM sets the laemory bound to the value desired. 

To extend meitcrY bound: 

As library subroatine: 

HAD, FOHTR&N or FAP: 

A = EXttEB. (ISC) 

INC contains an integer which will be used as an 
increment to extend the memory bound. 

A Upon return, A will contain the new aeaory 
bound which is the sum of the old memory bound 
and the increment in INC. If the sum is 

greater than (77777)8 or if the prefix of the 
argument is not P«E , TSX or TXH, return is 
made with A a nd the AC set to zero and the 
aieiBDry bound is not extended. 



(END) 



CTSS EBCGRAHnER'5 GUIDE Section AG. 6. 07 Paae 1 



Iden ti fication 

Frea or erasable storage management 
FREE, FHER, FRET 

Purpose 

Ona tachnigue of optimizing the amount of core space 
required by one program is to have each subprogram within 
tha program take temporary storage from a common pool and 
put it back when it is nc longer needed. 

Usaje 

As a library subroutine: 

AED: X=FREE(N)$, X=FeER(N)$, X=FRET (N , X) $, 

FAF: TSX FREE,4 TSX FRER, 4 TSX FRET,U 

PZE M P«E N F«E N 

STA X STA X ST A X 

N contains an integer specifying the size of the 
block of storage. 

X contains (address) the address of the start or 

lowest location of the block of storage. If X 

is returned as zero by FRER, no block could be 
obtained. 

FREE will find a block of storage either from free 
storage or by extending memory bound. If more 
space is requested than can be found, the 
following message will be printed, and EXIT is 
called : 

•nrnnn LOCATIONS OF FREE STORAGE ARE 
UNAVAILABLE 
(nnnnn is an octal number.) 

FRiSB serves the same function as FREE except that 
if not enough space is available, return will 
be to the calling program with zero in the AC. 

FRET returns storage to free storage. If a block of 
storage being returned overlaps memory bound 
or any block previously returned, the 
following message is printed and EXIT is 
called: 

*♦ ILLEGAL CALL OF FRET, BLOCK rrrrr SIZE 
nnnnn' 

(rrrrr is a pointer to the block, nnnnn is 
size; both in octal) 



(END) 



CTSS PaOGHAMMER'S SIimR ^oni-i ^^n ir. ft f^fl 



Reset file-wait return 
TILOCK 

PU££OSS 

A field called ILOCK exists hi thin the UFD entry for each 
fil2. This field cantains the number of users who currently 
have the file open fcr reading. If a user tries to write a 
fil2 whan its IL03K is greater than zero, he will 
autoiBdtically be placed in file-wait status until no more 
users are reading the file. If a user tries to open a file 
which is open foe writing, he will also be placed in 
file-wait status. IILOCK is a routine which has been 
providad to allow the user to avoid file-wait. A call to 
TILOCK in a prcgram sets a general return which applies 
until altered or removed to all I/C calls which would 
otherwise involve going into file-wait status. All 

background programs which use the file system must provide 
this call since any attempt to place background in file-wait 
status causes the background job to stop. 

ysa^e 

MAD: OLDBTN = TILOCK. (RETURN) 

FAP: ISX TILOCK, 4 

P2E RETUHH (note PaE rather than TXH) 

SLW OLDBTN 

RETURK is the location to which control will be 

transferred if an I/O call would normally result 
in file-wait. If RETURN is zaro, the normal 
execution of file-wait will be reinstated. 

OLBRTN upon return, the AC will contain the address of 
the previous return setting, if any. 



(END) 



flllTni? c;o~*-ir«n ifl.f._nQ 1?/fiQ 



Get array from free storage 

GETBUF 

Parjjosa 

To allow a MAD j-rogram tc obtain buffer spa^e by extending 
mainory bound, and to address the storage area obtained as a 
subscripted array. Ihis permits SAVED files of freshly 
loaied programs to be reduced in size, since the buffer area 
is not included in the SAVED file. 

Usaje 

To obtain a buffer: 

DIMENSION BUF (0) 

A = GETBUF. (BUF, SIZE) 

A block of core storage ot length SIZE+1 is obtained by 
extending the memory bound. The value of BUF is set to 
the absolute address of BDF less the absolute address 
of the last addressable location of this block (i.e. 
old memory bound + SIZE), expressed in two's coaplement 
font, module 2. P. 15. The old memory hound is returned 
in A . 

Elenents of the array obtained by GETBUF may be 
referenced by 



BUF (BDF + I) 

(for the Ith elenent) , where I may have a value from 
to SIZE. Multiple subscripts may also be used 
Dimension declarations will be of the form: 







DIMENSION BaF(0, BCIH) 

VECTOH VALUES BDIM = (dimension vector, see MAC manual) 

References are of the form: 

BUF (I, BUF+J) 
or BUF(I, J, BUF+K) 
etc. 

The last subscript (in the case of standard subscripts) 
is always the one tc which the address contained in BUF 
is added . 

To return buffer to free storage: 

SMEM. (A) 



CTSS EflCGRAMllER'5 GU ICE 



Section AG. 6. 09 



12/69 2 



whera A is the old memory bound previously returned by 
GETEUF. 

A = GEIBUF. {B1 , Si) 
B = GETBUF. (B2, S2) 
SMBM. (A) 

This will release buffer B2 as well as Bl, since the 
SMEB call resets the raeniory bound below both buffers. 

Ex ample: 

Assign a buffet to a file 



DIMENSION B(0) 

OPEN. ($8$, NAME1, NAME2) 

GETBUF. (B, ^12) 

BUFFER. (NAMEl , NAME2, 8(6+432) 



.432) 



^END) 



CQr-4--i/-kn » n 1 01 19/fcQ 1 



Identification 

Quary or modify supervisor parameters 
GKTLOC, GLOC, GETARY, SSTLOC, SLOC, SYPAR 

Purpose 

To enable a user to examine a supervisor parameter. To 

allow the system progra nuners to modify an A-core parameter. 

E§§ frictions 

SLOC and SETLQC may be used only by Mim6 programmers. 
GLOC, SLOC and sYPAR may not be called from FORTRAN programs 
unlass the location is shifted to the address rather than 
the decrement of LOC (or CODE). 

Usac|e 

Get the contents of a location: 

As supervisor or library entry: 

FAP: TSX 3ElL0C,a optional (TIA =HGETLOC) 

P2E LOC 
SLH UOBD 

As library subroutine: 

MAD: WORD = GLOC. (LOC) 

Upon return, WORD will contain the contents of 
the A-core location whose address is in LOC. 

Gat the contents of a block of A-core: 
As supervisor or library entry: 

FAF: rSX GETLOC, 4 optional (TIA =H5ETL0C) 

PZE LOC'n* 

P aE B UF 
or 

TSX GETARY,a 

PaE LOC 

PgE BUF,, 'n* 

MAC: GETARY.(LOC, BUF(N)...W) 

As a library subroutine: 

MAD: GLOC. (LOC, E[]F(N)...N) 

Upon return, the 'n' word array beginning at 
BUF for a FAP call or BUF(ti) for a Mi^D call 
will be set to the contents of the ' n' words 
of supervisor core beginning at LDC. 



CTSS fBCGRAMMER«5 GU IB£ Section AG. 7. 01 12/69 2 

Set th2 contents of a location: 

As supervisor cr library entry: 

FAE: CAL WORD 

ISX SETLOCU optional (TIA =HSETLOC) 

PSE LOC 

As library subroutine: 

MAD: EXECOTE SLOC.(WOBD, LOC) 

Upon return, the A-core location whose address 
is in LOC will be set equal to the contents of 
WORD. 

Get a supervisor parameter: 
As library subroutine: 

FAP: ISX SYPAR,U 
PZE CODH 
ST0 PARAH 

MAD: PABAM = SYPAB. (CODE) 

SYPAH returns a supervisor paraneter in the AC, 

CCCE contains a right adjusted integer which 
specifies which parameter is desired, 

nothing 

1 Last or lowest COBMON location used 

2 COH«OS length 

3 First location loaded 

U Prcgram length (i.e., memory allocation) 

5 System name 

6-9 reserved 

10* Contents of A-core location 



(END) 



rrpaa 0tic\aahHH9.a*Si GltiTDR Section AG-?. 02 12/69 1 



Get common file number 
3ETCF, GETCFH 

Pur£Osa 

GETCF will return the number of the common file directory to 
which the user is currently switched. 

ysdg.e 

As a supervisor entry: 

ISX GETCF, U (TIA =HGETCF) 

Upon return, the AC will be zero if the user is 
switched to hie own file directory. Otherwise, 
the AC will contain the number of the common 
file directory to which he is switched. 

As a library subroutine: 

FAP: TSX 3ETCF!i,4 
P^E CFN 
STO CPS 

FCRTBAN: CFS = GErCFH(CFN) 

MAD: CFS = GETCFN. (CFH) 

Both CFN and CFS will be set to the current common 
file directory number (0,1,2..). In Fortran, 
the file directory number is returned as a 
Fortran integer. This same value may be used 
later to call COMFL(CPN). 

S§.striction 

If a user switches to a common file, and then uses ATTACH 
(::ommdnd or file system call) to switch to another user's 
iiractory, GETCF will return the number of the commcn file 
to which he was switched, and give no indication of his 
current attached directory. 



(END) 



rT«:<: CRraR&MMRR*<; fSlTnF qtrntinn AK.l.ni IP/hQ 



ii§.ntifi cation 

Privileged users* calls to the I/O system 
UPDMFD, DELflFD, AriACH, ALLOT, MOVFIL 
LINK, UNLINK, SEIPIL, HSFILE 

Purpose 

Aiministrators and certain commands and utility programs are 
privileged tc alter the supervisor ani the accounting files. 
Certain calls to the I/O system may fce invoked only by the 
privileged users or ether users using the privileged 

commands. 



Mathod 

The accounting files contain the personal restriction codes 
for evary user of the system. When a user logs in, his 
restriction codes are placed in a vector uithin the 
suparvisor along with the other active users. When a user 
invokes a coimand, his personal restriction code is ♦OR'ed 
together with the code of the command to make up the 
restriction code which becomes part of his machine 
conditions. The L03IN command sets the low-order 6 octal 
iigits of the user restriction code, 

1 Oser may use common files 

2 Dser may use privileged calls to the I/O 
system. 

4 User may modify "PROJECTED" files of other 
users. 
10 User may refer to "PBIVATE" files of other 

users. 
20 User may modify the supervisor and I/O 

system . 
40 user may use the E3L display routines. 
ICO User may use the 6.36 supervisor entries. 
200 User may not use disk- loaded commands, except 
LOGIN and LOGOUT ("Restricted User", see 
Sectian AA. 1) . 
UQQ User may not alter file directory (not yet 
implementeiS) 
1000 User may modify standard options, subsystem 

status (see AG. 8. 05). 
2000 User may remain logged in after system 
camedown initiated (system operators only). 
1000000 Oser is background system. 
2C0CCCC User is foreground. 
UOOOOOO User is FIB, 
10C0CCCO User is incremental dumper. 
20000000 User is privileged command. 



CTSS PROGRAMMER'S GUIDE Section AG. 7.03 12/69 



A privileged ccmiDand sets the 1, 2, 4, 10, 20 and 1GC0 bits 
on. 

.._3 ■» J„J ..u;i^ ^.>*-^.^n V-;+ (lA io r\n (coo iCZ (^ '^\ 

sets the 1000 restricticn code bit, making the connsand 
"subsystem privileged". 

The bits which occupy the decrement may be moved left nine 
bit-positions to indicate the .not. condition, except in the 
fdsp of the trivileaed commani bit. 



Usa^s 
Update MFD: 



UfDMFD.($ PHOBN$,$ PROG$) 



UPDMFD places a new user (problem number programmer 
number) in the master file directory. With 

this call it is possible to update the MFD 
during time sharing rather than having to wait 
for a disk editor run. 

EBOBN is the right adjusted problem number of the 
form ANNNN. A is an alpha character, and HNNH 
is a four digit number. 

EROG is a one to four digit programmer number. 
Ncte the right adjustment and blank paddiag. 

Error codes: 

03. User already in M.F.D. 
OU. Machine or System error 
05. Illegal PROBN (i.e., 0) 



Dalsta from MFD: 

DELMFD. ($ PBOB!I$,$ PROG$) 

DEIMFD will remove a user from the master file 
directory. The DEIMFD will not be permitted 
if the user's record count is not zero. 

Error codes: 

03. User not found in M.F.D. 

04. U-F.D. still in use. 

Attach to UFE: 



Donno fc MMPo » c: rifiTnP c;f»r ti nn AG - 7 . 3 12/69 



MTAZH.{$ PROBN$,$ PBCGJ) 

ATTACH will attach the user's program to the file 
directory of user PROBH PBOG. The user dom 
has full access to the files and file 
directocy of PBOBN PBOG within the liaits of 
his restriction code. Files which may have 
been opened while attached to PRCEN PROG 
remain open even if the attachment is changed 
to a different file directory. 

Error codes: 

03. User not found in M.F.D. 

04. Machine or system error 

Quota allotment: 

ALLOr. (EEVICE, QUOTA, USED) 

AILCT may be used to allot a quota of records for 
each user, for each device by first ATIACHing 
to the users' file directory and then calling 
ALLOT. 

DEVICE is an integer or integer variable specifying 
the I/O device, 

1. Low-speed drum 

2. Disk 

3 . Ta pe 

QUOTA is an integer or integer variable specifying 
the number of records to be allotted to the 
user on the specified device. A record is 
currently 432 words. 

USED is normally not specified and should be used 
only to correct an error in the nuiber of 
records used. 

Error codes: 

03. Illegal device specified 

Move a file: 

KCVFIL. ($ NAHE1$,$ NAM£2$,$ PROBS$,$ PBOG$) 

MOVFIL is used to move the file NAHEl HABE2 from the 
current file directory to the file directory 
of PROBN PROG. Upon return from this call, 
the file nc longer exists in the current file 
directocy. 



CTSS PROGRAMMER'S 3 UIDE Section AG. 7. 03 12/69 



Error codes: 



03. File nDt found in current U.F.D. 

r\h t t^ n ^^ fmf^ r* r^ri t:\\ 

05. File is 'PROTECTED* 

06. File already exists in 'PROGH PROG* 
C7. Machine or System error 

08, File already active. 

09, Other U.F.D. not found 

10, Illegal use of M.F.D. 

Link to a file: 

LINK. ($NAMEU,$NAME2$,$PROEN$,$PR0G$, $N AM 3$, $NAMa$,MODE) 

LINK establishes a link in the current file 

directory to a file in some other file 
directory. Links may be established to the 
maxiaiuai depth of two, as specified by the 
supervisor, 

NAME1 NAME2 is the name which will be used to refer 
to the file in the currant file directory, 

PROBN FBCG specifies the file directory to which the 
link is being made. This file directory may 
contain the actual file or it may contain a 
link tc some other directory. 

NAM3 NAHU is the name by which the file is known in 
file directory PBOBN PBOG. If NAm3 NA MU is 
not specified, it is assumed to be the same as 
NAME1 NAME2. 

MODE is an integer or integer variable which will 
be 'OK'ed hith all the modes through all the 
links to the actual file. The resulting 

•OB'ed mode will be used as the mode in the 
current file directory. 



Error codes: 

03. File already in D.F.D. 

OU. Machite or system error 

05. *PROBN PROS' not found in R. F, D. 

06. Illegal use of M.F.D. 



CTSS FFCGBAMMER'S GUIDE Sedition AG-7.03 12/69 5 

Rainova a link: 

UNLINK. ($ IlIAME1$,$ NAME2$) 

UNLINK will remove the O.F.D. entry and the link 

associated with NAME! NAKE2, which was 

established by LINK. NAHE1 NAME2 is the name 

used to refer to the file in the current file 
directory, as it is in LINK. 

Error codes : 

03. File not found in U.F.D. 
Oa. File is net a »LINKED« file 
05, Machine or system error 

Date a file: 

SEIFIL. ($ NAME1$,$ NAME2$, DAITIM, DATEL U, MODE, DE VICE) 

SETFIL is used primarily by the file lead and 
retrieval programs to create an entry in a 
file directory with a specific date and time. 

DAYTIM is the date and time to be used as the date 
and time last modified in the format of the 
third word of a U.F.D.. (AD. 2) 

DATELU is to be used as the fourth word of a U.F.D, 
and contains the date last used and •AUTHOR*. 

Error codes: 

C3. Illegal device 

04. Machine or system error 

05. File is a link 



Unlock a file: 



BSFILE, {$ NABE1$, $ NAHE2$) 



RSFILE is used to reset the ILOCK field in a file 
e^try when, due to machine or system error, a 
file has become interlocked while no user is 
using it. This entry may only be used by 
system programmers privilege! to patch the 
supervisor, and only while key 22 is down on 
the operator's c:onsole (to prevent accidental 
calls) . 



CTSS PROGRAMMER'S GUIDE Section AG. 7. 03 12/69 6 



Error codes 



03. File nat found 

CU. Linked file net found 

05. Link depth exceeded 

06. File is an active file 

07. Systen or machine error 



(END) 



rTc:<; cprnBiMMFR'^ nriTHR St»rtion Xd^l^OU 12/69 1 



Identificaticn 

S3t diractory attached to 
ATTN AM 

Purpose 

ATTNAM returns the pcoblem nunber and prograomer nunber 
{PROBNO,PHOGNO) cf the directory currently attached to by 
the file system. Cf. WHOAMI, AG. 7. 05. 

Usa^e 

As a supervisor or library entry: 

MAD: ATTNAM. (A(N)...N) [N.LE.U] 

FAP: rSX ATI MAM, 4 

PAB A,,'n* or: PTH A,,» 



N PZE 



• n • 



Optional: 

AITHAW TIA =HATINAM 

On return, locations in array A will have been set as 
follows: 



MAP 


Contents 


thi 


A{N) 


PROBHO 


A 


A{N-1) 


PfiOGNO 


A + 1 


A{N-2) 


AUTHOR 


A+2 


AiN-3) 


FPSIOE 


A + 3 



where PBCBNO-PBOGNO is the user's currently attached file 
directory, FPRIOB is his file priority setting (set by 
SETPfil) , and AUTHOR is his author number, in binary. 

Only the standard error code 01 may be retucneS. 



(END) 



r"Pt:c cornpniKM FRtq niiTfiF fJerfion AG-7.05 12/69 1 



i d e n t i £ i c a t i c n 

Obtain usar status infocmatioD from supervisor. 
WHO A HI 

Purpose 

To provide comiaands and user programs with such pertinent 
system parameters as user identification, system name, and 
console identification. The subroutine operates at the 
level of "who is logged in and making the call," as opposed 
to "whose directory is the call coming from " - for which 
litter, see ATTNAM, AG.7.0U. 

Usa^e 

As supervisor or library entry: 

MAD: 



FAP: 



MHOAMI. {A(M) ...N) [N.LB.7] 

(OPN=PZE or TXH; n .LE . 7) 



ISX 


HHOAMI ,4 


CPN 


A.,«n' 


Optional: 




HHOAMI TIA 


=H HHOAMI 



On return, locations in array A will have been set as 
follows: 



MAD 


Contents 


IhE 


A(N) 


PBOBNO 


A 


A(N-1) 


EBOGNO 


A + 1 


A (11-2) 


STSHAM 


A+2 


A(N-3) 


IDCOEE 


A +3 


A(N-4) 


LOGIN 


A+a 


A{N-5) 


UFCNH 


A+5 


A (N-6) 


UNA ME 


A4 6 



where PRCBNG is problen number, PaOGNO is programmer number, 

SYSNAM is the six-character system name of the currently 

operating version of CTSS, IDCODl is the console 

identification cede, LOGIN is the name of the login command 

(changed during test sessions), OFDNM is the user's home 
file directory, and UNAHE is the user's name (last six 
characters only) . 



(END) 



rv<i<i CRnr;RiMNP.R«s nuTTF Section AG. 7. 06 6/69 1 



llsstifi cation 

Find named items in supervisor 
COMLOC, SNATCH, GAC, ACOPE 

Purpose 

A user program often wishes to know the location in core A 
of soma supervisor data item. COMLOC returns the A-core 
location of any variable in CISS common. SNATCH copies 

supervisor common into core E for later examination by GAC. 
ACORE returns the location in core A of any supervisor entry 
point and the load origin of the module containing the 
entry. 

Usa^e 

As library entries: 

LOC = COMLOC . {SYMBOL, -EBB-) 

COMLOC is called with the left-adjusted BCD name of a 
symbol in CTSS common. It returns the integer 
value which is the location of the symbol in core 
A. 

EBB is the location to which a transfer is to be made 
if SYMEOL is not found. If EBB is not supplied and 
SYMBOL is not found, COMLOC will print an error 
comment and return zero. 

The first time COMLOC is called, it switches to 
the system public file by a call to TSSFIL and 
reads in the current system common symbol table, 
extending the memory bound and packing the table 
into cere. (The common symbol table is named 
•'COMxOO SIMIB" where wx" is the fourth letter of 
the current system name returned by MHOAMI. ) 
COMLOC then searches the table for a symbol 
matching its first argument. Subsequent calls to 
COMLOC do not reguire re-reading the symbol table. 



SNATCH. 

COMTS = GAC. (SYMBOL, -OFFSET-) 

SNATCH on the first call, calls COMLOC to ietermine the 
size of crS3 coiaraon, extends the memory bound to 
make room for it in core B, and calls GEIARY to 
move all of supervisor coamon to core B. 
Subsequent calls to SNATCH just call GETARY to 
refresh the saved copy of supervisor common. 



CTSS PROGRAMMER'S GUIDE Section AG. 7. 06 6/69 



GAC retrieves the contents of SYMB3L+0FFSET at the 
time cf the last call to SNATCH by calling 
COMLOC. (SYMBOL) , adding the integer OFFSET (if 
3uf plied) , and looking in the saved copy of 
supervisor common. If SYMBOL is not fcund by 
COMLOC, an error message is printed and zero is 
returned. Since GAC does not call the supervisor 
or do I/O, it is very fast. 



WOBD = ACOHE.(NAME, -EBR-) 

ACORE is called with the left-adjusted naae of a CTSS 
module entry point. It returns a word which has 
the location in core A of the entry in the 
decrement, and the location of the origin of the 
module containing the entry in the address. If 
ERH is supplied and NAME is not found, a transfer 
will be made to the label EBR. If SAME is not 
fcund and no error return is specified, an error 
message is printed and zero is returned. 

The first time ACORE is called, it switches to the 
system public file and reads the file " (LOAD 
FILE)" into core, packing it and extending memory 
bound as necessary. This file is a complete 
description of how the CTSS supervisor was loaded; 
it is written by the system loader every tine the 
CTSS system is brought up. ACCBE than returns to 
the previous directory by a call to USRFIL, and 
searches the core copy of the loading information 
for an entry name matching its first argument. 
Subsequent calls to ACOHE do not require rereading 
of " (LOAD FILE)" . 

Examples 

To find the number of users logged in: 

NU = SLOC. (COMLOC. ($NOSBHS$) ) 

To print out the names of all logged-in users: 

SNATCH. 

T«H LL, FOR I = 1, 1, I .G. 10 
U'R GAC, ($PROBH$, I) . E. 0, T« C LL 
FR MESS. (GAC. ($UW ABES, I)) 
LL C'E 

Not3 that the ONAHE and PHOBU arrays will be consistent. 



(END) 



fTCC DonriD* MMPB f Q rillTnP CTof+inn UK 7 07 i:>/AQ 



I^SUliJicaticn 

Dyer A-ccre variable 
SETWBD, GETWBD 

Pur£osa 

Each logged- in user has one location in core A in the 
supervisor common vector "UABRAY". The GETWHD and SETWRE 
entries are provided so that the user may examine and set 
this location. Ihe CTSS supervisor makes no use of this 
location; it is provided for such applications as multi-pass 
compilers, which may wish to pass options or success and 
failura indications from one pass to another. 

Usage 

As a supervisor or library entry: 

rSX SirWRE, 4 optional (TIA =HSETWRD) 

PAB WORD 

This call will set the user's UARRAY location to 
the contents of WORD. The previous value will be 
returned in the logical AC. 

rSX GirWBE, a optional (TIA =HGETHRD) 

-PAR 0SE8M0- 

This call will return the contents of the ARRAY 
location beloging to USEBMO in the logical AC. If 
USERHO is no^ specified, the current user's UABRAY 
contents will be returned. 

Both SETHRD and GEIBRD can be called by MAD or FORTRAN 
programs. 

It is possible to use these entries for inter- user 
communication, since one user may look at another's ARRAY 
location. For example, to examine the UARRAY location 

belonqinq to PROB PB03 , the following BAD code will work: 

A* 

INDEX = ISIN.(PR08, PROS) 

H'B INDEX ,E. 0, T'O NOTIN 

HISWRD = 3L0C. (INDEX + COBICC. ( $U AfiRAY$) ) 

or 
HISWHD = 3E TURD. (INDEX) 

The other user's UABRAY value will be returned in the 
variable RISHBD. If the user PROB PRCG is not logged in, the 
program will transfer to the label NOTIN. 



(END) 



limp tia'-¥^nn tCZ TOR 19/ftQ 



Blip character 
3ETBLP, SETBLP 

Pur20se 

The CTSS supervisor has a feature which allows the user to 
raquest that a sequence of characters te typed every few 
seconds of execution. The SETBLP ani GETBLP entries are 
provided to set the character sequence and time interval, 
and to find out their current value. 

Osaje 

As a supervisor cr library entry: 

TSX SErELP,4 optional (TIA =HSETBLP) 

PAS CHARS 
PAB N 

This call will set the blip sequence to the three 
12-bit characters contained in CHABS. The blip 

will be typed every W seconds. If N is zero, the 
blip feature is inhibited. (This is the state 
when ths user first logs in. ) 

TSX SETBLP, 4 optional (TIA =HGETELP) 

PAB CHABS 
PAB N 

This call will return the current blip setting in 
CHABS and the current blip interval in N. 



(E8D) 



CTSS ERCGRAHMEH'3 GUIDE Section AG. 7. 09 12/69 1 



1 i§.]l t i f i ca ti cn 

Sit lina number of logged-in user 

ISIN 

Purpose 

All par-user arrays in CTSS supervisor coBmon are indexed by 
a "line number" cr "logical unit number" which is assigned 
to a user when he dials up. The maximum value for this index 
is " N" , an assembly parameter for the supervisor. ISIN 

raturns the logical unit number for a user, given his 
problam and programmer number. 

Usaje 

As a supervisor or library entry: 

TSX ISIN, 4 optional (TIA ^HISIH) 

PAR P80B 

PAB PROG 

SL W L UN 

ISItJ returns the logical unit number of PROB PROG in 
the AC. If PROE PROG is not logged in, zero is 
returned. 

ISIN may be called by MAD or FORTBAM programs. 



(END) 



CTSS PHOQRAMWEP. • S 5LiIDE Ser:tion AG -8- 00 Page 1 

I den t i f i ca t i c n 

Ssnaral discussion of MACRO command programs 

Pur^osa 

It is souetiffies desirable or convenient to be able to 
iaitiata one cDmmand which results in the automatic 
execution of several commands. Tools have been provided on 
savaral programming levels for initiating and controlling 
chains of conmands. 

Discussion 

Thara are at least three levels of user interest in chain or 
macro coirmand programs: 1) writing commands which may be 
usad within chains, 2) initiating chains from within a high 
level prcgraBBing language, 3) initiating chains at the 
michina language and supervisory call level of programming. 

Commands may be thought of as being subroutines without the 
conventional subroutine linkage. A standard command linkage, 
however, has been provided within the supervisor so that 
:;ominana arguments will always be available and retrievable 
from a standard place. All commands should terminate with a 
::all to CHNCOM rather than one of the conventional 
programming terminal routines. CHNCCM will continue a 
command chain, if there is one, or call DOBMST (or DEAD, 
depending on the memory bound) if there is no chain. 
Routines that will fetch the command arguments are COMARG, 
which is callable by MAD at: JORTRAN programs, and 3ETC0M, 
which is the supervisor entry. 

Two routines are available for executing single commands 
from tha program level: MEXCOM is a limited-use supervisor 
entry and XECOM is a more flexible subroutine which may be 
called by MAD or FORTRAN programs. 

Chains of commands may be constructed in a simple way as BCD 
line-marked or line-numbered disk files and executed by the 
MAD or FOBTBAH callable subroutine SCHAIS or by the command 
BUNCOM. SCHAIN and RUHCOH do a lot of the housekeeping and 
set up calls to the appropriate supervisor entries. 

On the more detailed level, chains may be constructed within 
tha supervisor, the C3mmand location counter may be set or 
interrogated, and the chains may be executed and chained by 
c=ills to supervisor entries, on this programming level many 
of the housekeeping details must be handled by the user. 



(END) 



CTSS PROGRAMMER'S SUIDE 



Section AG-8-01 



Paae 1 



Singla command 
XECDM, NEXCOM, NCOM 

PurposB 

To allow the user to execute a single conmand fron the 
program level rather than the command level. 

Usage 

NEXCOM: 

as supervisor entry: 



ZkL COMAND 

LDQ ABGI 

TSX NEXCOM, U 

as library subroutine: 

MCDM. (C0MAND,ARG1^ 



(TIA =HNEXCOM) 



CDMAND contains the BCD name, right justified, of the 
comiaand to be executed. 



ARG1 



HEXCOH 



is stored as the first argument in the current 
command buffer. If there is to be no argument 
to COMAMD, AfiGl should be the fence. If COHAHD 
expects an argument list and ARGI is not a 
fence, the previous contents of the current 
CDmmand buffer will be used with ARGI as the 
first argument. 

places the contents of the AC and MQ in the 
current command buffer and places the user in 
waiting-command status. Note that a fence is 
not placed in the command buffer following the 
argument. Control is not returned to the 
calling program except as may have been 
pre-arranged by CHNCOB. 



XECOM: 

as library subroutine: 

MAD, FOBTRAN, FAP: 

K = XECOM. (COHAND,LIST) 
EXECUTE XECOM. (COMAND,LIST) 

COBAND contains the BCD name of the desired command. 
Right justification is not necessary. 

LIST is any legal list specifying locations which 
contain the BCD names of the arguments 



CTSS PROGRAMMER'S SUTDE Section AG. 8. 01 Page 



appropriate to the command. Right 

justification is not necessary but the nuober 
of items in the list must be .LE. 18. 

K will be zero if execution was successful; non 
zero if failure. 

XECOM builds a chain of SAVE, CCHAUD, RESUME and 
calls CHNCOM. Thus control will be returned to 
the calling program after execution of COMAND. 
if COMAMD called CHNCOM. 



(END) 



<Za/~¥inr, ACl H 09 Pano 



liSfltif ication 

MACRO coirniand 
SCHAIN 

ParEose 

To allow the user to build a macro command program as a BCD 
iisk file and call foe its execution from the progran level 
rather than conimand level. A macro command program is a 
chain of commands which can te executed by issuing just one 
command, with or without arguments. 

Reference 

SCHAIN is the subroutine call which is the equivalent of the 
HUNCOM command. For a complete explanation, see section 
AH. 10.01 , PUNCOM. 

Usa^e 

MAD, FOBTBAN or FAP: 

A = dCHAIN. (FILN am, -ARG1 , ARG2, . , , ARGN- ) 
EXECUIE 5CHAIN. (FI LNA M, - ARG 1, ARG2 . . . .AR GN-) 

FILKAM specifies the BCD file containing the 

chain of commands to be executed. The 

secondary name need not be BCD as is required 
for BUNCOM. 

ABG»S are locations of BCD names of specific 

arguments to te substituted for the duamy 
arguments specified by the CHAIN 

pseudo-command. They may be single cr list 
variables and the names need not be right 
justified. 

A Upon return may contain a word of the 

form. ..XXX, which is not an error, but the 

primary name of a SAVED file representing the 

last dormant status yielded by the last 
command in the chain. 

SCHAIH will intersperse SAVE's and RESTCB's or 

BESOME'3 so that the chain specified in FILNAM 
may be of any length. Control is returned to 
the calling program upon completion of the 
chain. The chain may include any nuuber of 
RUNCOM specifications, since nesting and 
recursiDn are possible. 



(END) 



(-"T>cc cunno nmMKO^Q r.njrv <^firfinn ft fl . 8 - 1 Paap 



Chain control 

CHNCOM; (GET, G, SET, S) CLS; (GET, G, SET, S) CLC 

Purpose 

To allow a user to set up and control chains of coimands 
from the program level rather than command level. These 
routines are close to the supervisory level and require 
detailed control by the user. 

Method 

In order to build a chain of commands, the BCD name of each 
command and its aryuments must first exist in a fenced 
vactor. The vector foe each desired command is then moved 
into a command buffer within the supervisor and entered into 
its relative location within the command list (CLS) by the 
supervisor routine SEP CLS- The relative location of the 
first command to be executed in the command list is entered 
into the command location counter (CLC) and the length of 
the coramand chain is entered into the supervisor by SETCLC. 

Execution of the chain is initiated and continued by calls 
to CHNCOB. Commands can only be chained if each coemand 
terminates by calling CHNZOM so that the next command in the 
chain can be initiated. The calling sequence to CHNCOM 
specifies whether or not the calling program has a 
significant core image which might be useful to the next 
command in the chain. CESCOM does some housekeeping before 
calling the next command in the chain: 1) sets memory bound 
to zero if no core image was specified in the calling 
sequence, 2) sets the instruction location counter to be the 
word following the calling sequence to CHNCOH, 3) increments 
CLC by 1, and H) moves the next command buffer into the 
current coaaand buffer or calls DEAD or DCEMNT if no coiaand 
remains in the chain. 

Restrictions 

A command list must be .LE. 5 commands. 

Each command buffer with fence must be .LE. 20 words. 



CTSS EFCGBAMMEH'S GUIDI Section AG, 8 .03 Page 



y5a_ge 

To enter a cosmand in the coaiinand list oc ::oainand buffer: 
As supervisor ot lite at y entry: 

rSX SETCLS,4 optional (TIA =HSBTCLS) 

P2E TAB,,'n' 

« • » 

TAB BCI 1,coiBiDand 
BCI 1, argl 

OCT 777777777777 

As library subroutine: 
MAC or FORTRAN: 

EXECUTE SCLS. (TAB,N) 

SETCLS moves 20 words from TAB into the Nth connsand 
buffer in the command list, or into the 
Current command buffer if N is 0. A call to 
SEICLS with N = 0, does not initiate a 
cDmmand. A call to NEXCDH or XECOM is 

required to initiate the coiaaand. 

SCLS interprets MAD and FORTRAN calling sequences 
which specify backward arrays and moves the 
words froiB TAB only to and including the fence 
intD the command list. 

TAB is the location of the fenced command table 
(.LE. 20 words) containing the command and its 
arguments in BCD (right justified and blank 
padded). The fence is interpreted by the 
command and SCLS not by SETCLS. 

N 6 n specify the position within the command list 
( .LE . 5) . N = specifies the current command 
buffer. 

To copy a command from the command list or command buffer: 
As supervisor or library entry: 

TSX GEICLS,'* optional (TIA =HGETCLS) 

PSE BUFF,,»n» 

As library subroutine: 
HAD or FORTRAN: 

EXECUTE GCLS. (BUFF,N) 

GETCLS maves 20 words from the nth command buffer of 
the command list into locations beginning at 

BUFF. 



GCLS interprets MAD or FOSTKAN callincj sequences, 
calls GErCLS and stores the connnand buffer 
backwards in BUFF. Only the words to and 
including the fence are moved into BOFF. 

flUFF iBUSt be at least 20 words long for GETCLS. 

To set the command location counter: 

As a supervisor or library entry: 

ZLk A 

rsX SETCLC, 4 optional (TIA =HSETCLC) 

As a library subroutine: 

MAD or FOBIBAM: 

EXECUTE SCLC. (M,N) 

A contains a word of the foris PZE iD,,n. Both 

SEICLC and SCLC set the comniand location 
counter to m and the number of the last 
command in the chain to n. 

M or tD is the number of the conniand in the coBiaiand 
list which is the next to fce executed- (m .LE. 
5) . 

N or n is the number of the last command in the 
command list, (n .LE. 5). 

To query the command location counter: 
As supervisor or library entry: 

rsX GBTCLCU optional (TIA =HGETCLC) 

510 A 

As library subroutine: 

MAD or FORTHAN 

A = GCLC (H,N) 

M will be set to the value of the command 
location counter i.e., the position within the 
cottmand list of the next coaniand tc be 
executed, (a . LE. 5). 

N will be set to the position of the last 
command in the command list, (n . LE. 5). 

A will be set to a word of the form P2E m,,n. 



CTSS PHOGRAMMER'S SDIDE Section AG. 8.03 Page U 

To initiate or coatinue a chain: 
As supervisor entry: 

IDA urih^un,'* (xin -uv- un >-iJtJ/ 

PZE 'j' 

AS library subroutine: 
MAD or FORTRAN: 

EXECUTE CHNCOM (J) 

FAP: CAL = 'j* or TSX CHNCOB,U 

TSX CHNCOM ,4 P£E 'j • 

J or j 3=0 specifies to CHNCOM that no core image is 
available for the next command. j=1 means that 
a core image is available and nay be used by 
the next command. 

CHNCCM determiaes whether or not another command 
exists in the chain. If one exists, it is 
initiated. If no chain exists; DORMNT is 
called if j=1 , DEAD is called if j=0. 



(END) 



CTSS PROGRAMMER'S 3DIDE Section AG^B^O'i Page 1 

Ij^enti fixation 

Patch d current caamand argument 
GKTCOH, COMARG 

Purpose 

To extract the Nth argument from the current connnand buffer. 

Usa_ge 

As supervisor or library entry: 

PSX GETC0M,4 optional (TIA =HGBTCOH) 

P2E *n» 

GETCOM returns, in the logical AC, the Nth argument 
of the user's latest command, i.e., of the 
current command buffer. The command itself is 
number 0. The arguments may be numbered 1-19, 
including the fence. 

As library subroutine: 

MAD, FORTBAN or FAP: 

A = COMARG. (M) 
A = COMABG. (H, B) 
EXEC DIE COMABG. (H,B) 

The nth argument of the current command buffer 
is transferred to A and/or B. 



(END) 






Specify user options, subsystem status 
SBTOPT, RSOPT, LDOPI, aEIOPT, SETSYS, GEISYS 

Pur£Osa 

To allow a user cr his subsystem to modify the settings of 
his standard DptiDns , subsystem nane, and subsystem 
condition mask. Also to alien a user to examine his current 
options and subsystem status. 

Discussion 

Associated with each user, there are three status words 
maintained in the supervisor containing his standard 
options, his subsystem name, and his subsystem condition 
code mask and last condition code. 

User standard options occupy a half-word (18 bits) , and are 
intarprated as follows: 



■+ + 

I user options | 



1 Search user U FC first for command 

2 Search user or system files (not both) for command 
4 BESETF if CDmmand resets dormant prog. 

10 User subsystem trap enabled 

20 Inhibit v|uit signals for user 

40 Current user program is subsystem 

100 Automatic save before loading subsystem 

200 User is »dialable» 

Tha two low order bits are taken together to specify 
four modes of coimand file searching: 

Search system files then user files (normal mode) 

1 Search user files then system files 

2 Search system files only 

3 Search user files only 

The following disk- loaded commands are always taken from 
tha system files (provided that the user is allowed to 
use them) : 



CTSS EBCGRAMMER'S GUIDE Section AG. 8. 05 12/69 2 



LOGIN 

LCGOUr 

0T0L3G (user may net issue) 

CAEciCn (incc einent al uUmper onj.y) 

DSDUMP (incremental dumper only) 

DSLOAD (inccemental dumper only) 

FIEMON (FIE user and FIBMON only) 

OPIION (subsystem-crivileged user only) 

The RESETF bit specifies that if there is a dormant core 
image left from the last command, and the command 
currently being processed does not preserve this core 
imaje (i.e. not SAVE, MYSAVE, START, HSTART, SOBSYS, 
ENDLOG, RESETF, cr any B-core transfer command: USE, 
DEBUG, PM, etc.), any active files will be reset by a 
call to BESETF instead of being closed normally. This 
provides compatibility with previous versions of CTSS. 

The subsystem trap enable bit causes all program calls 
going to DEAD or DORMNT (including errors) to siaulate a 
call to NEXCOn for the command SUBSYS, provided that the 
call does not come from the user's suhsystem (option bit 
40 off), and causes all new commands issued from the 
terminal to pass through the subsystem processor (with 
the excefticn of exempt commands) . 

The quit-inhibit bit causes all quit signals to be 
ignored for the user. Program status will be unaffected 
if the user attempts to quit and buffered outpat will 
not be reset. N.B. The only way to stop a non-quittable 
program that has gone into a loop is to force an 
automatic logout by hanging up the data-phone (or 
turning off power to the terminal). Use this feature at 
your own risk! 

The subsystem execution tit, if on at command load time, 
causes a new core image being loaded to have subsystem 
privileges if the user does not have the subsystem 
privilege himself. Program calls going to dead or 
dormant status will execute normally if this bit is on, 
regardless cf the setting of the subsystem trap bit. 

The subsystem save bit if set causes the subsystem 
processor to simulate a 'MYSAVE progn T' before it loads 
the subsystem- 

The dial-permit bit allows remote terminals to attach to 
the user via the DIAL command. See section AH. 1.0 5 for 
details. 

Th3 user's subsystem name is interpreted as a six-character 
command name, which may be any system command or a user 
aisk -loaded command (SAVED file). 






+ + + + 4- + + 

I subsystem name | 

+ + ♦ + + ♦ + 

The subsystem condition code mask is a half-word quantity 
split into two 9-bit fields. The high order 9 bits are 
axaminad by the subsystem processor if the user has a core 
image left; the low order 9 bits are examined if there is 
currently no core image. Within each 9- kit field, the bits 
are interpreted as fellows: 

1 Trap new command 

2 Trap direct program call (»DEAD«, 'DDRHNT') 

^ Trap CHNCOM if end of chain or no chain set up 
10 Trap error condition (file system, PHV, etc.) 

Tha subsystem condition code occupies the high order 18 bits 
of the subsystem condition mask word. The low order 9 bits 
of thasa la indicate which of the possible subsystem trap 
conditions occurred to cause the subsystem processor to be 
antarad (zero if the SUBSYS command was issued directly by 
the user or his program). The following 8 bits specify ac 
arror code if the subsystem condition code was 10 ('error'), 
in oriar to indicate the type of error that occurred. This 
is not yet implesented, and the error code will be returned 
as 0. Tha high order (sign) bit is on if there was a 
dormant core image left. 

♦ + + + + ♦ 

1 I error | code | condition mask | 

♦ ♦ + + + + 

Usaje 

To set (turn on) bits in the option status word: 

As a library entry ... 

FAP: rSX SErOPT,4 or TSX SET0PT,4 

?FD 036/»bits» PAR BITS 

« • • 

BITS VFD 036/'bits' 

MAD: A = SEIOPT. (BITS) 

The bits specified as 'bits' will be ORed with the 
current contents of the user's option word and the 
result will replace bits 18-35 (right half) of the 
option word. The previous value will be returned in 
the accumulator. 

To reset (turn cff) bits in the ootion word; 



CTSS EBCGBAMMER'3 GUIDE Section AG. 8. 05 12/69 4 

As a libraty entry ... 

FAP: TSX RSOPT,a or TSX BS0PT,4 

t. T..n r>->t>iv.4*.,-.t DUD HTTQ 

. « • 

BITS VFD 036/«bits« 
MAD: A = BSOPr. {BUS) 

Th3 specified bits will be masked out of the current 
contents of the option word, and the result will 
raplace bits 18-35 of the option word- The previous 
contents will be returned in the accuaulator . 

To set the contents of the option word: 

As a supervisor or library entry ... 

FAP: TSX LDOPT,U or TSX LDCET,'» 

VFE 036/' bits' PAR BITS 

« • • 

BITS VFD C36/«bits» 
MAD: A = LDOPr, (BITS) 

The specified bit configuration will replace the 
current contents of bits 18-35 of the option word. The 
old value will be returned in the accumulator. 

To axamine current option settings: 

As a supervisor 3C library entry ... 

FAP: TSX GErOPT,U (optional TIA =HGETOPT) 

- SLW A - 

MAD: A = GETOPT. (0) 

Location A and the accumulator will contain the 
sattings of all available options in bits 18-35. In 
addition, the left half will contain status flags 
pertaining to the user's current core image. In 
particular, bits 12-17 specify the current typewriter 
input mode as follows: 

6-bit mode 

1 12- bit mode 

2 No-convert mode 
4 No- break mode 

1C Graphic input mode 

Also, bit 11 will be on if the core-B simulated 
interval timer is running. 



GUIEE Section AG. 8. 05 12''69 5 

To specify subsystem name and condition mask: 

As a supervisor or library entry ... 

FAP: rSX SETSYS,a (optional TIA =HSETSYS) 

PAR COMMND 
PAR MASK 

MAD: SETSYS. (COMHNE, MASK) 

The user's subsystem name will be replaced by COMMND; 
the subsystem condition word will be set to the 
contents of MASK. Option bit 10 (subsystem trap 

enable) is set by this call. 

To examine subsystem status: 

As a supervisor or library entry ... 

PAP: TSX SETSYS, 4 (optional TIA =HGETSYS) 

PAR COHMNE 
PAH MASK 

MAD: GEISYS. (COMMND , MASK) 

COMMND will contain the user's current subsystem name. 
MASK will be set to the contents of the subsystem 
condition word. Example: If the subsystem condition 
word contains 4C000400401 6 , this indicates that the 
subsystem is tD be called in for any call to CHNCOM 
attempting to gc dead or dormant because there is no 
chain set up (504004 mask), for any error not leaving a 
core image (000010 mask) and for a program call to DEAD 
(000002 mask) ; the subsystem will not be called in for 
any new command from the terminal (except SUBSYS of 
course) , for an error leaving a core image, or for a 
program call to DORHNT. The condition code of 400004 
indicates that the user's program called CHNCOM and 
fell out because no chain was set up, and that the call 
to CHHCOM specified a core image (400000 bit on). 

Only •GETOFT' and 'GETSYS' may fce called by a 
subsystem- restricted user from any program (or command) 
other than his subsystem. 



(END) 



Qar- f •« ^n ir: Q ni Pane 1 



Identification 

Ttaca of Subroutine Calls. 

ERB08 

Pur£OS3 

ERBOB is a subptcgram which may be called by FAP, MftD, or 
F3RTRAN programs in order to trac:e backwards to the main 
subprogram through the most recently executed chain of 
subroutine calls. 

Restrictio ns 

It FAP subprograms are used, they should include the linkage 
director and the instruction to save the contents of index 
ragistar £♦ must be included in the first twenty instructions 
of the subprcgrani. 

Each subprogram executed must have at least one arguaent. 

If EHROR is unable to complete the trace, the following 
massage is printed and control is returned to the calling 
progra m. 

TRACE FAILURf IN 'sub* 
EXIT FROM ERROR 

Usag[S 

MAD, FOBTRAM, or FAP: 

ERROR. (HESS) 

MESS is a BCD fenced message of . LE. 132 characters 
which will be printed on the user's console 
when ERROR is entered. 

ERROR will trace back to the main program through 

the last subroutine calls and print comments 

of the following type and then return control 
to the calling program. 

C(MESS) 

ENIRY ERROR CALLED BY 'subl' 

ENTRY 'subl' CALLED BY •sub2' 



ENTRY 'SUbn* CALLED BY (MAIN) 
EXIT FROM ERROR 



(END) 



CTSS PSOGSAMHER * 3 GUIDE Ssction AG. 10.01 Pa^e 



I d en t i f i ca t i c_n 

BCD or spread-octal to binary 
BCDEC, BCOCT 

Purgosa 

To convert the BCD or spread-octal representation of an 
integer to the equivalent binary integer. 

BCD to binary: 

As library subroutine: 

FCfiTPAN: EgUIVALENCE (XNUM, HUM) 
XNUn = BCDEC (X) 

ttAE: HUM = BCDEC. (X) 

FAF: rsx BCDEC, 1 
P2B X 

SIO NOM 

X is the location of the BCD word to be 
converted- X is assumed to be a BCD deciaal 
integer and leading blanks and signs are 
ignored. 

MOM and the AC will contain the right-justified 
binary integer equivalent to the absolute 
value cf X. 

Spread-octal to binary: 

As library subroutine: 

FCB7BAH: EQUI7ALINC1(XM0H,NUH) 
XMUM = BCOCT (X) 

BAD: HUM = BCOCT. (X) 

FAP: rsx BCOCT, 4 
PZE X 
STO HDM 

X is the location of the spread -octal word to be 

converted. X is assumed to be a BCD octal 

integer and leading blanks and sign are 
ignored. 

HUM and the AC will contain the right- justified 
binary integer equivalent to the absolute 
value of X . 



(END) 



P'Tt^c: EnrrinaMMPnt^ nnxvn 



<;<»<~f inn fta-in-fl? 



Pa n*» 1 



Binary to BCD 
DEFBC, DELBC, DEBBC 

Purpose 

To "onvart a binary integer to BCD with leading zeros. 

Usa^e 

As library subroutine: 

MAD or POBTRAM: 

A = DEFBC.(K) 
A = DELBC. (K) 
A = DEBBC- (K) 

A will contain a BCD decioal number (modulo 
S99999) , right- justified and zero padded. 

DEFBC converts the full 35 bit word (sign is 
ignaced) K into a BCD decioal number. 

DELEC converts the left half of », (sign is ignored) 
into a^ decimal BCD number. 

DEBBC converts the right half of K into a decimal 
BCD number. 



(END) 



f'TSS PROaH A MMRH ♦ *=; f^llTDR Sftn f i on Afi.in.n^ Psrro 1 



I d en t if i cat ion 

Binary to spread-octal 
OCABC, OCDBC, OCLBC , OCRBC 

Purpose 

To convert binary fields to spread-octal which is suitable 
for printing. 

Usaje 

As library subroutine: 

MAC or FORIRAN: 

A = OCABC. (X) 

A = OCDBC. (X) 

A = OCLBC. (X) 

A = OCRBC. (X) 

X contains the binary number to be converted 

A will contain the converted value in spread 
octal, i. e., six bits for each octal digit 
(0 -7 ) . 

OCABC converts the address field of X to 5 digits 
with leading blank. 

OCDBC converts the decrement field of X to 5 digits 
with leading blank. 

OCLBC converts the left half of X to 6 digits. 

OCRBC converts the right half of X to 6 digits. 



(END) 



iiTnw «;or' fi r»n aR.lfl.nU Punft 1 



L^^ntif icaticn 

Justif icaticn and padding 
BSEL, iEL, LJUSI, HJUSl 

Puc£Ose 

To allow the user to left oc right justify and/or to 
interchange blanks and zeros. 

Usacje 

Justification library subroutines: 

FAF: rsX LJUSI,1» TSX RJUST,a 

P2E HOaD P-ZE WCBD 

ST0 X STje X 

MAD: X = LJOSr. (WORD) X = 8JUST. (WORD) 

FORTRAN: I = LJUST (WORD) I = RJUST (WORD) 

WORD contains the word to be justified. Upon return 
the AC contains the adjusted word. 

LJUST by left shifting, leading blanks are replaced 

by trailing blanks. Leading zeros are not 

replaced. If the word is all blanks, "bbbbb*" 
is returned. 

BJUST by right shifting, trailing blanks are 

replaced by leading blaaks. If the word is 
all blanks, "fcthtt*" is returned. 

Interchange leading zero and blanks, library subroutine: 

MAD, FORTRAN or FAP: 

A = BZEL (fl) A = aEL (B) 

B contains the word to be modified. Upon 

return, the AC and A will contain the nodified 
word. 

B8EL replaces leading zeros with blanks. If B is 
zero, "bbbbbO" will be returned. 

2EL replaces leading blanks with zeros. If B is 
all blanks, "00000b" will be returned. 



(END) 



urSb 






Qo<-4- inn Afi, 10.05 



Paqe 1 



Identification 

General curpcse input/output conversion 
(I OH), (BTM), (FIL), lOHSIZ, STQUO 

Pur£Ose 

3-n-ral purpose conversion of BCD to binary or binary to BCD 
f^Mnput at output, respectively, according to a format and 
data list. 

Raf arance 

CC 186 FCBrRAH and HAD Fcrmat Specifications Spall 

Method 

A Standard 22 word buffer is assumed to ^^^J^^^^-H 
(77742)8. Presetting of certaxn upper core locations 

inlicdtes whether input or output conversion is desxred. If 
input is indicated, the contents of the buffer is converted 
i"?orcling to the specified format and stored in the 
l;::ationl specified by the list. If output is indicated, 

ddtd lEOEt 



the list s-ecif ica ticn is converted according to 



tha format and stored in the buffer 



Th3 actual I/O data transmission to or from the buffer must 
be performed by an I/O routine. Appropriate calling 
saquences to the I/O routines and (ICH) are ':°'» P^^^^^^^ «\^ 
and FOBTBAM for any read/write statements J^ich specify a 
format. Data or format errors cause (ICH) to call BECOUP. 



Osaje 

Output, binary to BCD: 
Fortran : 

TSX aSRSTH,4 

P£E FOBMAT,. SWITCH 

BTU 

IDC SYHEOL.t 
STR 



MAD: 

TSX USeSTH,4 
PaE FDfinAT,,SMT 



RTM 



STR FIRST,, LAST 



TSX (FIL) ,t» 



STR 



USRSTH set upper 

core Iocs 



OUT 



TEA* (lOH)^ 



USRSTH 



00 T 



Set upper 

core Iocs 
TRA* (lOH) 



TBA 2,4 



TRA 2,4 



CTSS EBCGRAMMER»3 GUIDE Section AG. 10.05 Page 2 

Input, BCD to binary: 

Fortran: MAD: 

TSX USRISH-U TSX USSTSK,li 

F£E FOBMAI,', SWITCH PgE FDR11AT,"^SWT 

HTN . RTN 



SIR 

STQ SYMEOL^t STR FIRST,, LAST 



TSX (HTN) ,4 STB 



USRISH Set upper core USRTSH Set upper core 

TRA* (lOH) TRA* (lOH) 

IN . IN . 



IRA Ir'* TEA 1,4 

FORMAT is the beginning location of the desired 
format. 

SWITCH is zero if the format is enclosed in 

parentheses and stored backwards in core. 
SWITCH is non zero if the format is enclosed 
in parentheses and stores! forward in core 
(e ,g . ECI) . 

SWI is zero if format is forward. SWT is one, if 
the format is stored backward. 

SYMBOL, t locates the variable to be converted. A loop 
may be included here for arrays or a series of 
LDC, STR. After each variable is converted by 
(lOH) , return is made following the STR in 
order to find the next variable to be 
converted. 

FIRST is the starting location of the list. 

LAST is the final location of the list. LAST may be 
lower in core than FIRST. If the list is of 
length one, LAST is zero. 

(FIL) is called to indicate that all the output data 
has been converted and ^e current buffer 
should be truncated. 



rT<;c: uRHfiRj MMRR « ^ r^riTDK 5?f»ntion AG. 10-05 Paae 



STH terminates the list in a MAD =all. 

(HTN) is called upon completion of the input data 
list. It restores the original (lOH) 
initialization (i.e., trap cells) . 

USRSTH is the user's output transmission program. It 
must initialize the appropriate upper core 
locations fcefore calling (lOH). After each 

line image is completed in the buffer, (lOH) 
will return to OUT with index register 4 set 
in such a way that "CLA ^,^» will put into the 
address of the AC the location of the buffer 
and in the decrement of the AC the number of 
words in the buffer. 

For MAD programs, OSRSTH will ba ..TAEWR and 
for FOB! RAN programs it will be (STH) or 
(SIMM) - 

USRTSH is the user's input transmission program. It 
must initialize the appropriate upper core 
locations, read in the first buffer load and 
then call (lOH). Control is then returned to 
FIRST and the first data word is converted and 
placed in the MO upon entry to (lOH) by way of 
the SIR. Successive words are converted into 
the MQ by subsequent STR* s. 

An ST8 following depletion of the Input buffer 
causes (lOH) to return control to IN in order 
to read the next record. 

For MAD programs, USRTSH will be .TIFRD and 
for FORTRAN it will be (TSH) or (TSHM). 



lOHSIZ: 

MAD, FAP, cr FORTRAM 

TSX lOHSlZ.U 
ME N 

N containing non-zero indicates to (lOH) that 
the diagnostic that "the field width of the 
format has been exceeded" should be 

suppressed. An M of zero resets the normal 
mode of printing the diagnostic. 

STQUO: 

MAD, FAP, or FOB IRA H 



CTSS PHOGSAMMEa'S GUIDE Section AG. 10.05 Page 



TSX S'IQUO,a 

Ihe next I/O statement will be initiated 
without resetting the buffer. that is, the 
line pointer is left where it was at the 
conclusion of the last I/C call. This is 
normally used in conjunction with the N 
modifier. {CC-186 for description of formats). 

The following locations nust be set before (ICH) is called 
for conversion : 

(77737)8 address Location of subroutine that (lOH) calls 

for input or output. This address 

corresponds to INPUT or OUTPUT. 
Tag 
decrement +1 if format stored backwards -1 if 
format stored forwards 
prefix IXL if FORTRAN type call TXH if BAD type 
call 

(77740)8 address location of first word of format 

sta tement. 
tag 
decrement user's index register 4 on initial entry 
to the input-output subroutine, 
prefix TXL for on-line printer TXH for all 
other I/O 

(77741)6 address scratch area for (lOH) to use for 

output. The number of words in the 
output record is stored here. 

tag ., ., . 

decrement fflaximuB number of columns available m 
input or output record (may not exceed 
132). 
prefix IXL for output (binary to BCD). TXH for 
input (BCD to binary) , 

(77742)8 The beginning of a 22 word buffer from 

which BCD data is converted to binary or 
into which BCD data is placed after 
binary tc BCD conversion. 

(7777 1)8 address location of symbol table (if any) 

address the address of RTS as ETN is the 
location to which programs should return 
after calling ( 10 H) . 



(END) 






Iiilim.isa.ti on 

Fortran integers to/from full word integers. 
PINT, MINT 

Puriiosa 

Fortran II integers occupy the decrement portion of a 

computar word. Most other systems, including MAD, use full 

word integers. These two routines will convert from 
dacremsnt to full ward or from full word to decrement. 

lJ3aj.a 

As a library subroutine: 

Fortran: EQUIVALENCE (A, J) 

A = PlSr (I) I = MINT (J) 

MAD: J= PINT. (I) I = MINT. (J) 

INTEGES J, FINT., I INTEGER I, MINT., J 

FAF: TSX FIN1,4 TSX MINT,U 

paE I P»E J 

sro J sTO I 

I is a full word (MAD) integer. 

J is a decrement (FOHTRAN) integer. 

A is eguivalent to J. 

FINT converts from full word to decrement integer. 
If the integer is too large, the following 
message will be printed and the integer will 
be taken modulo 32768. 

MAD INTEGER EXCEEDS 32767 

MINT converts from decrement integer to full word. 



(END) 



c£»^4-i*-*T> ^n in na o/ac; i 



iSantif ication 

Compleioent, OB, and AND functions 
COM, ORA, ANA 

Pur£Ose 

COM exacutes the machine instruction COB, OBA executes CBA, 
an3 ANA executes ANA. 

Usaje 

FOETBAN: COMA = COM (A) 

ORABC - ORA (B,C) 
ANADE = ANA (D, E) 

MAC: COMA = COM. (A) 

ORABC = ORA. (B,C) 
ANACf = ANA. (0, E) 

On return from COM, the arithmetic AC will contain the 
complement {'one's ccmplement*) of A. 

On return frcE ORA, the arithmetic AC will contain the 
result of 'oring* B and C. On return from ANA, the 

irithmatic AC will contain the result of 'anding* D and E. 



(END) 






I3antif icatiqn 

Internal conversion cf stored data according to a foriaat. 
DECODE, ENCODE 

Purgosa 

To encode (to BCD representation) or decode (from BCD 
rapresantation) data in machine rapresentation , according to 
a MAD/FOETBAN format statement. 

Usage 

As library subroutine: 

FCBTHAN: A = DECODE (FHT, TEXT, LIST) 

MAD: A = DECODE. (PMT, TEXT, LIST) 

FAE: TSX $E£COEE, U 

PZE FMT 

P2E TEXT 

PZE AR3 1 



PZE ARGN 

STO A 

Tha FAF call may also simulate FORTRAN and MAD calls: 

FORTRAN MAD 



TSX 


*BE30D£,1 


TSX 


FMT 


TSX 


TEXT 


TSX 

• 


ARG1 


• 

TSX 


ARGN 


STO 


A 



TSX 


$DEC0DE,U 


TXH 


FMT 


TXH 


TEXT 


TXB 

• 


ARG1 


TSX 


ARGK( j) ,,ARGK(m) 


TXH 


ARGN 


STO 


A 



where 

FMI refers to the format statement to be used in 
converting the data. 

1) la a FORTRAB (or FORTRAN simulated) 
call, it may be a setting from a call to 
SEIFMT. If SETFMT is not used it should 
be the K-specif icaticn of the format 
statement, e.g. , 

^ A = DECODE (5H (513) , TEXT, list) 
The format is expected stored in reverse 
order wuth FMT pointing to the first 
location (normal FORTRAN compilation) . 



CTSS EBCGFAMM£H«3 GUIEE Section AG. 10. 09 3/66 2 

2) In a MAD (or MAD simulated) call, FMT 
should point to the first location of 
the format statement, the format being 
_». — jjj ■; r. »-auoi-s« rirflor fnoraal MAD 

compilation) . 

3) In a FAP call, where the prefixes are 
PZE's, FMT should point to the first 
location of the format statement, the 
format being stored forwards. 

TEXT is an array which contains the BCD to be 
decoded, or into which BCD information will 
be stored after encoding. If the call was 
from a FOBTBAM or MAD program (or FORTRAN or 
MAD simulated program), the array is stored 
backwards. Otherwise the array is stored 
forwards. 

NOTE: In calls to DECODE, each new item of 
TEXT mast start in a new machine location. 
Due tc the way records are transmitted, the 
memory bound should be at least 21 words past 
the start of the last record. This is 

ensured with normal loading procedure. 

LIST is a list of arguments. It can be any length 
and may be single variables, subscripted or 
net, or MAD lists e.g. A(i)...A(n). 
Not allowed are FORTBAN implied 'DO' loops, 
and FAP tagged variables. 

A is a integer giving either: 

1) Far ENCOEE, the length of the resultant 
text. 

2) Far EECOEE, the number of words picked 
up from TEXT in order to fill the list. 

"A" will be zero if the calling sequence is 
not recognized by COLT or if no arguments are 
specified in LIST. 



(END) 






Binary/BCD Conversion 
DTBC, OTBC, ETDC, BIOC 

Purpose 

Convert decimal ar spread-octal BCD numbers to binary: 
convert binary tc decimal or spread-octal BCD. 

R^§tEi£li2£ 

These routines are usable from FAP prograns only. They may 
not be called directly from BAD or FOHTRAM programs, since 
the calling sequences are incompatible. 

Usaie 

Decimal- to- binary conversion 

LDC DEC 

TSX DTBC,4 

SLW BIN 

BIN will contain the binary integer represented by the 
bed string contained in DEC. 

Octal-to-binary conversion 

LDQ OCT 

TSX OIBC, 4 

SLR BIN 

After the call, BIN will contain the binary integer 
represented by the spread-octal number contained in 
OCT. 

Binary- to- decimal conversion 

LDQ BIN 

TSX BTDC, U 

SLW DEC 

After the call to BTDC, DEC will contain the bed 
representation of the binary integer found in BIN. 

Binary-to-octal conversion 

LDQ BIN 

TSX BTOC^U 

SLH OCT *- 

After the call to BTQ€, the spread-octal representation 
of the hiah order 18 bits of BIN will be returned. The 



CTSS PKOGRAMMER'S jUIDE 



Section AG, 10. 10 



12/69 



low order 18 bit of BIN will be returned left-adjusted 
in the HQ, t3 be used for another call to BTOC. I.e. 
the following cede will store the spread-octal 






tJXUO \J X. U i. Vi M It ^ 11% 



J. \JK^U. tx KJ II i 



OCT and CCI+1 : 



LOQ 


BIN 


TSX 


BIOC, 4 


SLW 


OCT 


TSX 


BIOC, U 


SLW 


ocr+1 



(END) 



Sactior. AG. It). 11 12 -'69 1 



t^en tif icatioi] 

Padding 

PAD, BZL, NZL, ZEL, NBL 

P u £ £ OS e 

Allow the user tc {jad a bed word with arbitrary leading 
::harac:t3rs. 



Usa^e 




Arbitrary paddin 


g: 


CAL 


HOBD 


TSX 


PAD,t» 


PAR 


=HAAAAAA 


PAR 


=HBBB3BB 


SLW 


RESOLr 



All leading A*s will be replaced by B*s, and the result 
returned in the logical AC. 

Exauple - tc convert • XYZ' to •♦**XYZ': 

TSX PAD,U 

PAR =H (blanks) 

PAR =H****** 

The following entries malce internal calls to PAD: 

BZL - Replace leading zeros by blanks 

NZL - Replace leading zeros by nulls 

ZBL - Replace leading blanks by zeros 

NBL - Replace leading blanks by nulls 
Calling sequences are all of the foria 



CAL 


WORD 


TSK 


XXX, 4 


SLW 


RESULr 



Restriction 

Thase routines aay be used by FAP calling programs only; 
they may not be called directly by MAD or FORTRAN programs. 



(END) 



v.^^,^ 1. <.vvy w » n ij L4 iJ u »* uui-i^lj OeUUi-UU «VJ, lU. |^ 1^/69 I 

I^JBiiJ ication 

Left and right justification 
ADJ, LJ, RJ 

Pur£OS3 

Left or right justify a character string within an arbitrary 
fiald. 



ysaje 






Sanaral 


form : 






CAL 


WORE 




ISX 


ADJ, 4 




iHB 


^HAflAAAA 




PAH 


SWII3H 




SLU 


RESULr 



If SKflTCH is zero, leading A's will become trailing A»s 
(left- justificatioE) ; if SWITCH is non-zero, trailing 
A's will becDue leading A»s (right- justification) . 

Example - to convert • XIZ' to • XYZ •: 



rsx 


ADJ,U 




PAR 

PAfi 
SLW 


=H 
= 
RESULT 


(blanks) 
(left- justify) 



The following entries make internal calls to ADJ: 
8J - Right-adjust, field of blanks 
LJ - Left-adjust, field of blanks 

Calling sequences for these entries are of the form 



CAl 


NORC 


TSX 


XX, 4 


SLW 


RfSULI 



S®StEi£tion 

These routines may be called fro» PAP programs only; the 
calling sequences are incompatible with HAD and FORTRAN 
forms. 



(END) 



1 o /t a 



li i fi 1 Ji£i.£S. t io n 

Strip leading blanks or zeroes 
BZ57 

Pur£OS9 

To convert leading zeroes or blanks to null characters 
(octal 57) for use in output formatting of BCD inforaaticn. 

Usa^e 

HAD: A = BZ57. (B) 

FAP: rSX BZ57,a 

PAB B 

sro A 

Location B contains the word to be converted. On return, 

both A and the AC contain the converted result. 



(END) 






Identificati.cn 

Variabla length calling seguence processor 

COLT, SELAH, MDL 

Pur22S^ 

To provide one routine which general purpose subroutines 
might call to interpret variable-length calling sequences 
ginarated by MAE, FORrBAN or FAP. This roatine will 

deterifline the type of ca 1 ling- prog ram and the number and 
typa of arguments in the calling-program. 

Us 33.6 

Local definitions: 

PrograiB is the routine which is calling COLT. 
Calling-program is the routine which is calling 
the prcgram. 

CDLT, as a library subroutine: 

TSX C:OLT,U 

paE lea 

IR U contains, in the decrement, tha contents of 
index register U at the time the program was 
called. 

AC upon return, will contain, in the decrement, 
the number of ai:gunents in the calling 
sequence tc the program and, in the address, a 
code specifying the type of the 

calling-program. The codes are: 

unknown, or no arguments 

1 FAP 

2 FOR THA 8 

3 HAD 

Index register 4 will contain the two's coaplement 
of the location in the calling-program to 
which the program should return, i.e., the 
location following tha calling sequence. 



CTSS EBCGRAMMER'S GUIEE Section AG. 11. 01 Page 2 

iJKLAB; what type of acyuiaent: 

CAL* COLT 

O xa •J1-' un. 11 

CAL ABG 

AXT BETUBli,1 
SELAR TRA ♦♦ 

RETURN 

ABG is the argument from th€ calling- prograo 
which is tc be exanined. 

RETORM is the location to which SELAB is to return. 

SELAR will place a code in index register 1 
indicating the type of arguoent 
C unknown 

1 FAP 

2 FORTBAN 

3 HAD single argument 
U MAD list with TIX 

5 MAD list with STR 

AC upon return, will contain in the left half the 
significant part of the argument (TXH, ISX 
etc.) 

MDL, MAD list processor: 

CAL* COLT 

AHS 18 

SI A HDL 

CAL ABS 

HDL TSX ♦♦,1 

ABG is the MAD list argument from the 

calling-program to be examined. 

AC upon return will contain: 

address - number of words in the list 
decrement - the increment to be used in 
indexing (+1 or -1) 
prefix - TXH (plus) if the list is 
forward or TXL (minus) if the 
list is backward. 



(END) 



CTSS PROGHAnnKR'5 3UIDB Section AG. i 1.02 Page 1 



I d en t i f ica t i c n 

Datarmine type of calling progtaa and FILSAM 
GNAM 

Purpose 

To provide a routine which general purpose routines might 
call to determine the type of calling-program and a file 
nima if one be requested. 

Uaaie 

Local definitions: 

Program is the routine which is calling GNAM. 
Calling-program is the routine which is calling 
the program. 

As library subroutine: 

TSJC GNAM, 4 
P2£ IBM 
-OPN FILNAM- 

OPN may be Pa E, TX B, or TSX. 

IR4 contains, in the decrement, the contents of 
index register 4 at the time the program was 
called. 

FILNAH (optional) is the first of two consecutive 
locations in which the file name will be 
stored (forward if PSE, backward if TXH) . The 
file name is assumed to be located by the 
first argument in the calling sequence to the 
program. 

AC will contain a code, right- ad justed integer, 
specifying the type of the calling-program. 

unknown 

1 FAP 

2 FOB IB AN 

3 MAD 



(BHD) 



CTSS EFCGBAflflliy'S uU XLC aeCciOu hvj.ii.uj ray« 



List transmission 
M0VE1, M0VE2, B0VE3 

Purpose 

To tramsmit data specified fcy an argument list from the 
calling program to the called program or transmit any list 
spacifisd data ftom one place to another. The argument 

lists may be MAD, FOBrBAS or FAP and the data arrays may be 
forward or backward. 

ysaj.© 

As library subroutine: 

rSX M0VE1,U 

OP BGDATA,, -ENDATA- 
OPN 

rSI M0VE2,1» 

OP BEGLSir,,-ENDLST 
ALPHA OPN 

Sia DATQDT,,LSTOUT 
BETA OPN 

ISX H0irE3,U 

OP may be ISI, TXH, P«E , TIX or STB. The 
decrement argument may be used only with TIX 
and STB. 

TSX and IXH signify a single argument or 
backward array base. 

P£E signifies a single argument or forward 
array base. 

TIX and STR signify an argument list whose 
beginning location is specified in the address 
and whose ending location is specified in the 
decrement. Note that the list may be forward 
or backward depending on whether the address 
is less than or greater than the decreaent. 

BGDATA is the beginning location of a block of core 
in the progcaa in which the data will be 
stored. 

ENDATA (specified only when OP is TIX or STR) is the 
ending location of the data block. 

BEGLST is the begining location of the list which 
specifies the data to fee moved. 

ESDLST (specified onl]i when OP is TIX or STR) is the 
ending location of the argument list. 



CTSS FRCGRAMMER'S GUTCE Section AG. 11.03 Page 



ALPHA is the cetucn from M0VE2 at which time the kZ 
contains the first data item as specified by 
BEGLSr. 

STB causes the storing of the AC in the data block 

specified by BGDAIA. If this fills the data 

block, return is made to DATOUT and the AC is 
aeaningless. The next data item frosa the list 

is then placed in the AC and return is made to 

BETA. If there is no next itea in the list, 
return is made to iSTOUT. 

If BE3LST vis specified as an array base, 
successive SIR'S will cause the transmission 
of successive elements of the array. The 
number af elements thus transmitted must be 
controlled by the user. 

DATOUT is the return location if tha data block is 
full. Ihe A3 is meaningless. M0VE1 may now be 
called again to initialize another data block. 

LSTOUT is the return location if the list is 

exhausted M0VE2 may be called to specify 
another list or another STR may be executed if 
moving an array. 

OPN may be any programming to establish loops and 
use Dr modify the AC if desired. 

M0VE1 initializes addresses and indexing for t&e 
data block and also initiali7es the SIB trap 
cells to entries to this routine. 

M0VE2 initializes addresses and indexing for the 

list, initializes the trap cells if not 

already done, and gets the first data item in 
the AC. 

MCVE3 restores the trap cells. 



(END) 



CTSS PSOUKAnnKK ' ;3 jUiur. ae;^ uiv^n nvj....«-. » -^ - 



Nima a format or file name 
SETFMT, SETMAM 

Purpose 

To simplify FORTBAU calls to the library disk routines by 
providing formats and file names with labels which then may 
b3 usaa in calling sequences to library routines. 

Usage 

F08TBAS: CALL SSrNAM (FILNAM,12H NAMEl 1IAWE2) 
CALL SBPFHT (FORMAT, nH ( ) ) 

FIIHAH is the location which is to contain a pointer 
to the actual file name NAMEl HAnE2. 
HAME1 liiAME2 are the actual primary and 

secondary names of the file, right-justified. 

FORMAT is the location which is to contain a pointer 
to the actual format, 

pointer is a word which contains in the address 
portion the address of tha first word of 
eithec the format or file name. The left half 
will contain a TSX if the call was made by a 
Fortran or FAP program or a TXH if the call 
was made by a MAD program. Bit positions 

12-17 will contain (77)8. 

These two routines allow the library disk routines to 
ba called with FILMAM and FORMAT as arguments instead 
of the actual BCD information. 

i. e., CALL DHBITE (FILHAM, PCBKAT, LIST) 
instead of CALL DWBITE (12H NAMEl NARE2, nH ( ), LIST) 



(EHD 



C'i'iiS f HULiKAnnstt ' S SiJlDE Seutitiu AG. 12.01 5/66 



Get the date and time of day 
3BTIBE, GETTM, GIDYTM 

Purpose 

To provide the user >)ith the current date and tise of day. 
The formats in which information is returned differ; they 
are described under Usage. 

Method 

Tha time is computed by using values from the interval tiaer 
to update the last reading of the chronolog clock (last time 
somaona logged in). The interval timer is incremented sixty 
times a second. 

Usa^e 

1) GBTIKE 

AS supervisor or library entry: 

TSX GETIME,4 optional (TIA =HGETIHE) 

SLW ri«E 
STQ DATE 

Upon return, the logical AC will contain 
the time of day as an integer in 60ths of a 
seccnd. The MQ will contain the date in BCD 
as "HUDDyi". 

2) GETTM 

As library subroutine: 

MAD, FOaiBAN or FAP 

CALL GETXH (DATE, TIME) 

DATE is the location in which the date will be 
stored in the BCD form "BM/DDb". 

TIME is the location in which the time will be 

stored in the BCD form "HHHK. H" . HH is the 

hour of the day (0-23) and MM.M is the minutes 

after the hour to one tenth of a minute 

(0-59.9). 

3) GTDYTM 

As supervisor or library entry: 



CTSS ERCGBAM«ER»5 GUIDE Section AG. 12.01 5/66 2 

MAD 

TIME = GTDYTM- (0) 

FAF 

TSX GTDYIM,'* optional (TIA =HGTDyrM) 

SLH TIME 

TIME is the location in which the date and time 

will be stored in (binary) "file system 

format". See Section AD. 2 for the 

description of date and time last nodified 
U. F.D./M.F.D. items. 



(END) 



i_xi;s f KuvattanncH ' i •sui.ua saccion ava.iiS.u^ fage 



l3anti£ication 

Timer interrupt and stop watch 

TIMER, JCBTM, BSCLCK, STOPCL, KILLTR, TIKIFT, BSTBTN 

P urpose 

To provide the user with the ability to time parts of a 
program and/or set a time limit on parts of a prograa. 

Method 

The foreground supervisor normally runs with the clock 
function turned off. A call to any of these time routines 
will turn the clock on. The interval timer is then used to 
time tha function as specified by the user. The interval 
time is incremented sixty times a second so that all integer 
timas will be in 60ths of a second. 

S astrictions 

The simulated clock (core B interval timer cell) may cause 
an intarrupt only every 200 milliseconds tecause that is how 
often it is updated by the supervisor, but it will be 
in-remanted every 60th of a second. The execution of any 
command {a.g., MACHO or CHAIN) will turn the clock function 
off. The job time is initiated to 73 minutes upon the first 
call to the timer rather than at the actual beginning of the 
job. CLOCON and CLOCOF should not be used if the timer 
routinas are being used. 

Osa^e 

All of the entries may be called by HAD, FAP or FORTBAS, If 
tha prafix to the argument is non-zero (i.e., MAD or TXH in 
FAP) the integer variable will be full word integers. If 

tfaa prafix is zera, the integers will be in the decrement. 

To initialize or reset the stop watch to zero: 

EXECUTE RSCLCK. 

To read the elapsed execution time since the last call to 
RSCLCK: 

EXECUTE STOPCL, (J) 

J is an integer variable which will contain the 
time used since the last call to RSCLCK in 
5 0ths of a second. 

To read the elapsed execution time since the first 
initialization of the clock: 



CTSS PROGRAMMEa'S GUIDE Section AG. 12.02 Page 



EXECUTE JOBTM- (J) 

J is an integer variable which will contain the 
elapsed execation time since the first call tc 
one of the timer routines in 60ths of a 
second. 

To initialize an elapsed time interrupt, i.e., an alarm 
clock: 

FORTRAN: ASSIGN 3 TO H 

CALL TIMER (J,N) 

MAC: EXECUTE TIMER. (J,S) 

FAF: rsx riME8,a 
P2E J 
PZE S 

J is an integer variable specifying the length 
of time in 60ths of a second that the clock 
may run before interrupting. 

S is the statement (location) to which control 
should transfer when the tine, to the nearest 
200 milleseconds, has elapsed. 

TIMER Only nine calls to TIMER may be stacked. Any 
iBore than nine will be ignored. 

To continue the instructions which were interrupted by the 
alarm clock : 

EXECUTE RSTRTN. 

To void the last setting of the alarm clock: 

EXECUTE KILLTB. 

To provide foreground/background compatibility to job time 
remaining : 

EX BCD IE TIMLPT. (J) 

J is an integer variable which will contain the 

amount of time in 60ths of a second which the 

job has remaining to run. The first call to 

any of the timer routines will initialize the 

job run time tc 72 hrs. The job run time for 

background jobs is taken from the 
identification card. 



(EHD) 






lis.iiii.li.siii.2S. 

Sinulated interval tinec 
CLOCON, CLCCCF, UPCLOC 

Purpose 

To 3aus3 the supervisor to simulate the interval tiiier for 
the user. 

Restriction 

Th3se routines should not be used if one of the following 

routines is to be used: 

TIMER, JOBTM, fiSCLCK, STOPCL, KILLTH, TlftlFT, ESTfiTN- 

Ma thod 

If the clock function is on, the B core interval timer cell 
(location 0000 5) will be updated by the supervisor at each 
time burst (200 Billiseconds) or on a ::all to UPCLOC. It 

will ba updated by the elapsed time (running tine, net real 
time) in 60ths of a second. Any B-core interval timer 
ovarflow trap will be interpreted at the tiae of the update. 
Th2 status of the simulated interval timer is not affected 
by coiBiBands which preserve the :;urrent core image: START, 
SAVE, EB, DEBUG, etc. In addition, it is restored from a 
saved file by RESUME or CONIIN. The clock function is 

normally off. 

Usaie 

Turn the cloclt function on: 

As supervisor or library entry: 

ISX CL0C0H,4 optional (TIA =HCLOCOH) 

Turn the clock function off: 

As supervisor or lifcrary entry: 

ISX CLOCOF,'* optional (TIA =HCLOCOF) 

Update the clock and check for trap: 
As supervisor or library entry: 

rSX UPCLOC, 4 optional (TIA =HUPCLOC) 



(END) 



. . -, ^^-.-n-^ <- i. ; „» t r- 1T nil lO/AQ 



I dentif icaticn 

Priot time used 
RDyxiM 

Purfiosa 

To print a 'ready nessage* on the terminal indicating 
running tine and swap time used since the last 'ready 
massage'. The ready message is identical to that printed by 
the supervisor en calls to DEAD and DOBBHT, and is of the 
form : 

p ttt. ttt+sss.sss 

where 'sss.sss' is the swap time used in seconds and 
•ttt. ttt' is the execution time used, also in seconds. 

Method 

The supervisor maintains incremental user charge time and 
running tiise to aid the user in judging efficiency of his 
programs. The RDYPIM entry is a user interface into the same 
pLogtam used by the supervisor in printing reaiy lines. 

U3ag.e 

As a supervisor or library entry: 

ISX RDIlin,'* (optional TIA =HBDYTIM) 



(END) 



Cai-^-irtn trz 1^ fin /Afi 1 

I^sjStif icaticn 

List of miscallanaous library subroutines: 

Tha following is a list of miscellaneous TSLIB1 subroutines. 
Further information or one page write-ups nay be obtained 
from tha consultants. 

SFDE 



DEAD 


DFSB 


DFMP 


CCEXIT 


DFDE 


lOSET 


lOEAB 


lOENC 


lOSCP 


lOITR 


(SLO) 


(SLI) 








.01300 


,01301 


.01311 


.03310 


.0331 


MAXO 


M&Xl 


XMAXO 


XHAX1 





MINO 


niNi 


MOD 


XMCD 


XSIGN 


SIGN 


Dill 


XDIM 


EXP 


EXP (1 


AC3S 


ASIN 


L3G 


SQBT 


SIMCS 


XSHEQ 


FLIP 


BANNO 



XMINO XMim 



XLOC 






INT 


XINT 


XFIX 


EXP (2 


EXP(3 




ATAN 


ATN 


COS 


SQB 


TAN 


COT 


XSIHEQ 


XDETRH 


XDTBH 


SETO 


INDV 


DPBV 



SIN 

TANH 

DETCS 



(END) 



dxc^C 



IdentificaticD 

Floating-Point Overflow and Underflow 
(FPT) 

Pucfiosa 

To process the underflows and overflows which lay occur 
during the execution of floating-point operations. 
Underflows are set to zera, the lowest possible absolute 
number, and overflows halt execution. 

Mathod 

An underflow or overflow a utcma tically causes a transfer of 
control to location 8 with the location of the instruction 
following the offending instruction stored in the address of 
location 0. A spill code is stored in the decrement of 0. 
IE an underflow condition exists, (PPT) places zero in the 
proper register and transfers back to the instruction 
following the floating-point instruction which caused the 
underflow. 

If an overflow condition exists, (FPT) proceeds to do the 
following : 

1. It prints on one line the coaaent: 

PLO-POINl OV-FLOH AT OCT ICC XXXXX ABS, 
or XXXXX BEL, PBOG naae SPILL xxxxx 

2. It then calls the library subprogran ERROR, which 
prints an error traceback, if possible, enabling 
the user to determine the control path leading to 
the error. 

3. After this information is complete, BXIT is 
called. 

Tha spill codes are produced as follows: 



Oparation 


AC 


MQ 


Deer. Portion 

Bits 
12 14 15 16 17 


Spill CSde 
in octal 


Add, Subtract 




Underflow 














1 


01 


Multiply, and 
Round 


Underflow 

Overflow 

Overflow 


Underflow 
Overflow 














1 
1 


1 
1 

1 


1 



1 


03 
06 
07 


Divide 


Underflow 


Underflow 






1 

1 








1 


1 




11 
12 



CTSS PHOGHAMHER 



R'S SUIDE 


Section AG. 13.01 


8/65 2 




U nderf low 


Underflow 1 


1 1 


13 




overflow 1 1 


1 


15 



Bff active Address 
of a Double-Precision 

Instruction is Odd, 1 '*0 

(except DST) 

A transfer tc (FPI) is placed in register 8 by .SETUP, a 
Cill to which is autoiuatically inserted into every POBTRAN 
and MAD main prograoa compiled at the Computation Center. 



(ESD) 



CTSS FRCGRAMMER'S GUIDE Section AH-I-OI 1?/fiQ 



Log in 
LOGIN 

Purpose 

Log out any previous user of this console; identify the new 
usee; initialize accounting information for the new user, 

Usaje 

— > login prcbn name 
W HHMM. M 
Password 
— > private password 

STANDBY LINE HAS BJEN ASSIGNED 

YOU HAVE XXXXXX 

PBCBN EBOG LOGGED IN Hd/DD/YY HHBM.H FB3M UNHID 

LAST LOGOUT WAS WM/DD/IY HHMH.B FBCK UNITID 

HOME PILE CIHECrOHY IS PBOBN UFDMM 

-message of the da y- 

CTSS BEING 03 EE IS SYSNAM 
R a -183 + .133 

PBOBN is the user's problem number, assigned to his project 
by tha IPC administrative office. 

NAME is the user's last name, of wich only the last six 
:;haracters are used. 

PASSWORD is the user's private password, which must match 
that found in the accounting files before the user can be 
logged in. After typing 'Password', the computer turns off 
the printing mechanism of the console, so that the password 
will not appear on the page. 

PBOG is the user's assigned progracmer number which 

corresponds to the ccmbinaticn of PBOBN, NAHE, and PASSWOBD. 

XXXXXX nay be any combination of the following files: 

MAIL BOX - Hail from other users 

UBGENT MAIL - Mail from the system 

PROGL SAVED - Saved file from automatic logout. See 

section AH. 1.02 concerning automatic 

logout. 

UMITID is the console identification code 

UFDNM is the user's home file directory, if not the same as 
his prograimer number. This line omitted if UFDNH is same as 
PBOG. 



CTSS PROGRftMnEK*S 3 tJiDE Section AH. 1.0 1 12/69 2 

MESSAGE OF THE DAY is the contents, if any, of the file 
•MBSSAG TODAY' in the public file directory 111416 CMFLOU, 
and contains infcrmaticn of interest to the user. 

SYSNAM is the name of the current version of CTSS. 
Error messages 

ALREADY LOGGED IN 

The user is already logged in fro« the same console. No 
further action is taken. 

PROBN IS NOT A PBOBLEM MUMBEH 

A problem number consists of a letter (usually 'C«, 
•M«, 'N«, or •!•), followed by one to four digits. The 
problem number supplied on the command line does not 
satisfy this requirement, 

PROBN NABE NCT FCOND IN EIRECTORY 

The ccnibination of problem number and name is not in 
the accounting files. 

PASSWORD NOT FOUND 18 EIRECTORY 

The password supplied is incorrect for the user PROBN 
NAME. 

NO TIME ALLOTTED FOR THIS SHIFT 

The user has zero tiae allotment for the current shift. 
Sea TTPFEK, AH. 1.04. 

YDUR ACCCUNT IS OUT OF FUNDS 

The user's account is overdrawn. He should make 
arrangeneats with the IPC administrative office, e.g. 
submit a new requisition. 

YDUR ACCOUNT HAS REACHED ITS TERMINATION DATE 

The user's account has expired. He should make 
arrangements with the administrative office. 

USER MAY NOT USE THIS CONSOLE 

The user's unit group restricts him to specific 
consoles, of which the current console is not one. 

UNIT GROUP n NOT FOUND 

System error, the user's unit group as specified j.n the 
primary accounting file does not appear in the unit 
group file. Notify the systems staff. 

IF YCU LCG IN, YOUR FIB JOE HILL BE DELETED 

DO YOU WISH TO LOG IN, 

The user is currently logged in on FIB. If he replies 
•yes', the fib job will be logged out, and he will be 
logged in; otherwise the fit job will continue to run. 



r-Tcc Don/-!DiMMi?olc '::riTnp car»*-irvTi hu 1 n ^ lOrtQ 



PaOBN PBOG ALREADY LOSGED IN FROM OMITID 

The user is already logged in from a different conscle. 
Notify the administrative staff in case of unauthorized 
use. 

PARTY 6Rf MUHBEB n IS WRONG 

Systam error, illegal party group specified in the 
accounting files. Notify the systems staff, 

CTSS IS BEING BROUGHT DOWN 

The system is in the process of being shut down for 
scheduled routine isaintenance or system difficulties. 

ALLOTTED TIME EXCEEDED FOR THIS SHIFT 

The user's time allotment for the currant shift is 
exhausted. See IIPEEK, section AH. l.OU. 

YOUR DATA PHONE IS HONG UP 

Machine or system error; notify systems or operations 
staff. 

DISK ERROR IN ACCOUHIING FILES 

Machine or system error; notify systems staff. 

TIME ACCCONTING FILE IS LOCKED 

One of the accounting files cannot be opaned. Machine 
or system error; notify systems staff. 

PR0B8 UFDNM NOT IN M. F. D. 

The user's home file directory cannot be found. Notify 
systems or administrative staff. 

SYSTEM FULL, TRY AGAIN LATER 

The system is currently filled to capacity, and the 
usar trying to log in does not have a priority line. 
Wait a few toinutes and try again. The HELLO command may 
ba used to determine if a login will be permitted: the 
number of users currently logged in mast be less than 
the maximum allowed on. See AH. 1.06. 

LOGIN COHflABE INCORBICI 

Error in command format or accounting files, or other 
arcor encountered during login process. The user is not 
logged in. 

NO LOGIN 

Login refused for whatever reason specified, -e.g. 
account overdrawn, allotted time exceeded, etc. 

P^Etl ii£5]i£s and ^rioritj liiies 

Tha party group allotment specifies the number of users in 
aich party group who may log in regardless of current system 
load, maximum number af users, etc. Such users are said to 



CTSS PROGHAMKRa»S 3DIDE Section AH. 1.01 12/69 4 

have priority lires. At present, only system administrators 
ini programmers, ESL display scope users, and users involved 
in prescheduled deionstra tions using CTSS are assigned 
priority lines; they are no longer assigned to user groups. 
All other users are assigned standby lines, and are subject 
to being automatically logged out by the systeo in the event 
of excessive overload due to too many users logged in, or to 
baing refused access for this reason. 

Party group is always standby except that FIB and the 
DAEMON (incremental dumper) are always priority lines. 



(END 



nilTnP fiar' i-i nn iH 1 9 1 9 / AQ 



Identification 

Log out 

LOGOUT, Automatic logDut 

Purgosa 

Allow the user to terminate his console session, update any 
a^crounting information, inform the user of his total time 
used, and in the event the system was full, allow another 
usar to login. In addition, automatic logout allows the 
system to initiate the logout procedure; in this case, the 
user's current program if any is saved in a disk file from 
which execution may be continued at a later date. 

Usacje 

User-initiated logout: 

LOGOUT 

Logout will unmount any file system tapes currently 
mounted by the user, update the accounting files with 
the user's time used during this console session, 
delete all temporary files in the user's home file 
directory of which he is the author, release any 
attached remote consoles, hang up the user's home 
console, and exit to the CTSS supervisor to reset all 
switches and status words associated with the user. 

System-initiated logout: 

(response) 
WAIT 

AUTOHATIC LOGOUT 

Automatic logout is a chain of two ccmmands, neither of 
which is directly issuable by the user: 

ENDLOG - Simulates 'MYSAVB progL T« 
OTOLOG - Special entry to logout, does not delete 
temporary files ^. 

ENDIOG creates a S AV EC file of the user's current 
program, if he is net in 'dead ' status. The file name 
used is 'progL', where 'prog' is the user's prcgramaer 
number. This file is created in tem£orarj[ mode and may 
be restarted by 

RESUME progL 
or CCNTIN progL 



f 



(END) 



<5a-i-ir.n AH-I-O^ 12/69 1 



Foraground Initiated "Background" 
FIB, DELFIB, P8FIB 

Pur£Osa 

Th2 BUNCCM facility (AH. 10.0 1) allows predescribed sequences 
of coniiands to be executed. The user of BUHCOB, however, 
must remain logged in and may not make any other use of his 
console until the cofflpletion of the sequence. 

The FIB facility allows the user to specify files which are 
to be executed by B0N3OM when and only when the user is not 
logged in frost a foreground console. The supervisor 

schedules a FIB job in the same scheduling queues as regular 
foraground jobs. (The FIB Monitor - a ficticious user - 
actually logs the FIB user in "over itself"; that is, on the 
lina FIEWON had.) 

S astrictions 

The user must have a time quota allotted for FIB jobs (shift 
5). A usar's FIE jab cannot be run while its donating user 
is* logged in. A user who logs in during execution of one of 
his FIB jobs will cause that jot to fce automatically legged 
out. A user may have only one FIB job scheduled to run in 
any given two-haur period — but see "Batching", below. As 

one might expect, there is no way for FIB jobs to receive 
console input. 

Usaie 

To initiate a FIB job: 

FIB »AHE1 -LIBIT- -TIME- -DAY- 

HAHE1 is the primary name of a file NAME1 BUHCOH 
which is a list of the commands to be executed 
by BUMCOM as a "background" job. 

m 

LIBIT is the maximum execution tiiBe lim^^ in 
minutes, which the user wishes to place^Tii the 
job. If LIBIT is not specified, a time limit 
will be set by FIB. Mo FIB job will be allowed 
to exceed a certain maximum time, which is 
currently set at 10 minutes (this is also the 
value used when no limit is specified) . A FIB 
job which exceeds its time limit will be 
automatically logged out; it may be restarted 
by the user. 

TIHE and DAY specify a date and time (up to one 
month away) before which the job will not be 



CTSS PBOGRAMHES'S 3UIDE Saction AH. 1.03 12/69 



run. TIME is expressed in "military 

ti«e"(.GE. .AHD. .LB. 2359); DAY, of 

course, is .GE. 1 .AND. .LE. M, where N is the 
date 3f the last day of the month in which the 
couinand is issued. If a time earlier than 
"now" is specified, the coBiaand will assume 
that the next day (if TIME is less) or the 
next Bonth (if DAY is less) is aeant. A LIHIT 
lust be given if a TIME is to be; a LIBIT and 
a TIME aust be given if a DAY is to be; 
ordering of these arguments is fixed. If no 
pre- scheduling is specified, the current time 
will be used. 

To delate a waiting FIB job: 

DELFIB NAHE1 

To ietarBine what FIB jots the user has pending, for when 
they are scheduled, and what time limit has been placed on 
tham : 

PBFIB 

*FIBJOB FILE' will be searched for the user's jobs and the 
relevant information will be printed on tha user's console. 

Mathod 

FI8 jobs are run one at a time on a f irst-croae-f irst-served 
basis. A FIE job is run in the same scheduling gueoes as 
foreground jobs but as the result of no console interaction, 
it moves to the iDwer priority queues. Tha donating user is 
logged in; the commands listed in the RUHCOn file previously 
specified by the FIB command are executed by BUBCGM; and 
whan the list is exhausted or the time limit is exceeded, 
the job (i.e., the donating user) is logged out and FIBMOH 
logged back in. Calls to WRFLX(A) (which normally cause 
typing at the user's console) cause writing into a file, 
$$$FIB OUTPUT, in the user's file directory. 

N. B j i This file is in 12-bit mode and must be PBINTed 
accordingly. 

Calls to DEAD or DORMNl will result in an automatic logout. 
Cills to the following subroutines will result in a 
Protection Mode Violation followed by an automatic logout: 

ALLOW, AXrCON, FOBBID, GETBLP, RDFLXA, RDLIHA , 
RDMESS, BEDLIH, BELEAS, SBT6 , SET12, SETELP, 
SLAVE, SLEEP, SNCLIN, SNDLNA, WAIT, WRHIGH, and 
WRMESS. 



IE a FIB job is logged out for any reason, it oust be 
restarted ^ the user. The FIB job running at system 

shutdown tiise will be run to completion or until it exceeds 
its tioa limit. If a FIB job is logged cut because it 
exceeded its tine limit it is logged out by ENDLOG so that 
as much as possible is saved. 

The user cannot be legged in while his FIB job is running. 
I£ he is logged in when his FIB job*s turn to run coaes, the 
FIB job is passed over and the next FIB job is tried. The 
job that was passed over retains its relative position in 
the list of FIB jobs until it can be successfully logged in 
or until the user who initiated it deletes it. If the 

user's FIB job is running when he tries to log in, he will 
gat this message: 

IF 5fOU L03 IN YOUR FIB JOB HILL BE DELETED. 
DO YCU WISH TO LOG IN, 

It tha user types 'yes', his FIB job will be automatically 

logged out, and LOGIN will continue to log his in. If he 

typss 'no', he will nDt be logged in, and his FIB jcb will 

continue to run. 

"i^tchin^" 

It is not desirable t3 allow any one user to monopolize FIB 
time by requesting several long jobs at once. However, if 
othsr jobs are not waiting it is not desirable to prohibit a 
user's running successive jobs. Therefore, the FIE command 
has baan implemented as follows: a user may have only one 
job £ra-scheduled to run in any given two- hour period in the 
system's FIBJOfl FILE (which is written by the FIB command); 
but when FIBMDN logs the user in for running a job, the 
antry corresspondiag to the job in FIBJOB FILE is removed 
before the jcb begins. If the job itself contains a 

non-pra-scheduled FIE command, then, that command would be 
acceptable, and, indeed, would be entered in FiBJOB FILE to 
ba run after any pending jobs previously raguasted by other 
users. (Pre-scheduled jcbs whose TIMEs have not yet arrived 
are skipped when the FIB Monitor looks for work.) of» 

= oursa, if there are no other requests, the job would^e run 
as soon as the current (calling) job terminates. The'effect 
of all this is analogous the Background "express- run" 
batches, where only cne job per user per batch is permitted; 
in FIB'S case, however, the "next batch" is always starting. 



(END) 



r".T>cc CD m DKMMPDt? nriTrU QQr-+-ir»n aHinU 1 ? /ftQ 1 



I ilSSllll ca t i n 

Examina time and stDCage guotas 
TTPEEK 

Pur£Ose 

Allow the user to list his adiainistr atively allotted CPU 
time and secondary storage quotas and his current time and 
storaga used. 

Usaje 

TTFEEK 

Tha usar's total time used since login is printed, followed 
by his time alloted and used for each shift, and his drura, 
disk, and tape quota if any and current usage. 

Shifts are as follows: 

Shift 1 Hon.-Fri. 08:00 to 18: CC 

Shift 2 Mon.-Fri. 18:00 to 24:00 

Shift 3 Daily 00:00 to 08:00 

shift H Sat.-Sun. 08:00 to 24:00 

Shift 5 FIB asage 



(EHD) 



rTss FRrnRiMMRR*'; raiTns «:<»<-*- inn 4H 1 rm io/aq 



lilfitifi cation 

Attach remote terminals 
DIAL 

Purpose 

To connect a dialed- in terminal to a user as an attached 
r»mot3 console. 

Usa^e 

From a dialed up but not logged-in console, issue the 

comnand: 

DIAL prob prog 

where 'prob prog* is the logged-in user expecting to attach 
tha tarminal. If »prob prog' is logged in and has option bit 
200 set (see OPriON connand, section AH.10.0M), the terminal 
is mada an attached remote console of 'prob prog*. 

A call to AITCON by 'prob prog* is no longer necessary with 
this procedure (although not harmful). 

Hiving once attached the console, • prot prog' nay call 

supervisor entries SLAVE, saDLIM, REDLIN, etc., or may use 

tha public command SLAVE SAVID, as desired, just as with 
previous CTSS systems. 

To disconnect the terminal, a 'quit" signal may be issued 
from the terminal itself, or it may be released by the 
attacher ('prob prog') with a call to RELEAS. All attached 
remote consoles are automatically released by logout- 

S®§trictions 

CTSS commands are not accepted from an attached remote 
console; any input typed is either saved for the attacher to 
raid via REDLIN or is sent to the attacher* s input buffer, 
in the case of an II slave. 

The DIAL command may not be used when logged in. 



(EHB 



n<; 1 o ycQ 



S 



LiSfiii fixation 

Dialup message 
HELLO 

Purgosa 

Print a message giving system name, number of users, maximuia 
number of users, and the date and time when a user dials 
into CTSS. In addition, alloh this information to be gotten 
(vid the same mechanism) at any other time. 

Method 

With the CTSS system numbered MIT8A2, the supervisor 
=ore-resident module which printed the dialup message was 
removed, and replaced by a B-core command program to print 
ths same message, together with a means whereby it is 
initiated for the user when he dials up to the computer. 
This was done primarily to free up supervisor core space, 
but in addition gives the added benefit of being expandable 
to provide more information, e.g. system response. 

Osa^e 

Dial intc the 709tt installation at the Information 
Pro::essing Center (see sect. AC. 3), or issue the command 

HELLO 

Response is cf the form 

BIT8A2: 10 USEBS AT 10/03/69 1242.7, BAX = 30 

In addition, if the card image file "DIALUP MESSG» exists in 
the public file directory niU16 CHFLOU , it is printed. 

This command may be used at any time, whether logged in or 
not. 



(END) 



„„—_.„ ^,.-r^^ .>-,„i.i„„»uTni ijt^f. 



Ilantif icatjon 

AED - ALGOL Extended for Design 
D. T. ROSS - X5880 

Purpose 

A general purpose programming system including a compiler, 
source language debugging facilities, and a library of 
subroutines. The compiler is especially suited to system 
programming, but includes algebraic statements, recursive 
functions, and aixed algebraic expressions for general 
purpose programming as well. The compiler language is an 
extended foru of ALGQL-60, minus multi -dimensional arrays. 
Some of the syntactic forms of ALGOL are modified, such as 
procedure definition. Additional features include plex 

structure processing (a generalization of list processing) , 
packing of data storage, and an input-string macro and 
synonym feature which includes conditional compilation. The 
subroutine library includes packages of routines for 
Eraa-Eormat input-output, for building of symbol tables for 
language processing, for plex dump and relocation, for "free 
storage" storage allocation, for use with the ES L display 
:;onsol3, and tot the "AED Jr." system, an experiaienta 1 
language processor. The ABD command is the stable, tested 
v-rsion of the compiler. TAED is the experimental ccmpiler, 
including new features in the checkout process. LAEE is the 
spatial, extended version of the CTSS loader which contains 
additional features, such as loading a remote list of 
programs. The AED command contains additional options for 
source file conversion into extremely compressed or expanded 
block structured formats for ease of understanding. 



aaf 2£ances 



HAC 


146 


MAC 


154 


HAC 


169 


HAC 


198 


MAC 


199 


HAC 


207 


HAC 


208 


HAC 


213 


HAC 


225 


HAC 


226 


HAC 


278 



AED-0 Programmer's Guide Feldraann, Ross 

Warnings 8 Restrictions in AED-0 Peldmann 

"LCADEB: A New Version of the Holman 

BSS Loader" 

PLEX-DOHP 6 Relocation in AED-0 Fox 

Stack manipulation in AED-C Coe 

"Internal Hemos for AED users" Feldmann 

"Flash No. 10 - Nein CTEST2 Feldmann 

Command" 

••Flash Ho. 11 - AEDBUG Usage" Fox 

Argument Checking for AED Walsh 

Availability of AED Jr. Systems Ross 

AED Bibliography Ross 



(END) 



r.TfiSi PBrfiRAWMRR*'? GIITDE Section AH-2-02 Paaes 



li=.aikl.i.£s.ii2B. 

BEFAP - Bell Labcra tcries' 7094 assembly language 
O.C, Wright 

Purpose 

BEFAP is a version of FAP «ith a more powerful macro 
compilar and with the ability to handle compressed source 
decks directly (see CRUNCH). Its advantages are the 
abilitias to edit larger files (via the alter feature with 
CHUMCH decks) and to produce more readable listing files. 
An immadiate benefit is the ability to use and modify 
languages under CrsS which were developed and written in 
BEFAP. (e.g., BLODI,ALWAC, SNOBOl) 

R3f argnces 

IBM C28-6235 FORTRAN II Assembly Program(FAE) 

MAC 179 BEFAP consmand within CTSS B, U. Bayles 

Usa_ge 

E£FAE NAME1 -'(CRUN)*- -'(LIST)'- 

NAMF1 FAP is the nane of the source file to be 
translated. Files NAHE1 BSS and NABE1 SYMTB 
will be created and any old versions will be 
deleted. 

(CRUN) specifies that the crunched file, HAME1 
CRUNCH, should be translated instead of NAHF1 
FAP. 

(LIST) specifies that a listing file, NAMEl BCD, 
should also be created. It will be a 

line-Backed BCD listing file which may be 
printed cn-line by the PRINT comnand or 
off-line by RQUfiST PRIST or PBIHI control 
card. 

If both (CHUN) and (LIST) are specified, they 
must be in that order. 



(END) 



CiOO trtlUvjnHnniin ■ iJ alixuii ocL-uxwu nua^.u^ ra^^ 



Identification 

COGO-90 - Coordinate Geometry Language 
D. Roos 

Purposa 

COGO is a language and programming system for solving 
gaometric problems in civil engineering. 

Research Uepcrts: 

B6U-12 CCGC-90 : Engineering User's Manual Boos, Miller 

R6U-18 COGO-90: line Sharing Version Roos, Miller 

B6U-5 The Internal Structure of COGO-90 Roos, Miller 

Usage 

Tha systen is activated by typing the time sharing command, 
COGO. Data may be read from the disk or typed in via the 
remote console. The same options are available for output. 

Modi ficat iocs 

Tha format of sevatal COGO commands has teen changed since 
the publication cf the above manuals. The revised formats 
ara 

READ/CISK HAME1 NAME2 

Succreading CCGO cammands are read from the disk file NAME1 
tiAnE2. 

DELAY/PBIUT M 

Succeeding output is written on the disk in file .TAPE . N, 
whare N is any number from to 9. 



(EMC 



<:iaft-inn IkU . 7 . aU Q/fkf, 



COMIT - Symbol manipulating and string processing 
Bob Fabry, University of Chicago 

Parfioss 

COMIT is one of several available string processing 
languages. It is very powerful for perfDrming string 
manipulation, such as substitution, rearrangeaent and 
duplication, on strings of alphanumeric characters e.g. 
natural language text. It is not so powerful on arithmetic 
facilities ncr complex structures. 

COWIT_II_0£eration_on_CTSS 
SuBfflarjj 

1. The command COMIT ALPHA accepts any input file named 
ALPHA COMIT as a COMIT II program. 

2. Compiler and interpreter error comments appear on the 
typewriter . 

3. Some interpreter errors put COBIT into BBEAK status 
instead of terminating the run. 

4. Pushing break button once puts COMIT into BREAK status. 

5. In BHEAK status, typing: 

T or TEHMIMATE terminates the run. 

C or CONTINUE continues the program from the next 

rule. 

R or RESTART restarts program at second rule, 

immane to further treaks until end of 
program is reached, then continues 
program from the point at which the 
break occurred, 

D or DUMP gives a COHDUHP. 

number executes that number of rules, then 

gives "OfERRULE" stop. 

6. Channel L is far output on the typewriter, and channel 
R is for reading from the typewriter keyboard. 

7. Other CCMIT channels refer to files with names of the 
form ALPHA CHANEL, unless other names are provided by a 
COMSET. 

8- Writing in COMIT on channel ALPHA will create or 
append to a disk file named ALPHA CHAHEL. 



CTSS PBCGBAHMER'5 GUIDE Section AH. 2. 04 9/66 



9. Reading ia COHII fcom channel ALPHA will read from a 
disk file named ALPHA CHANEL, starting with the 
beginning of the file. 

10. A channel being written or read is open. Only 3 files 
may be open at a time. *F« , *RW , *XF , reading an 
end-of-file, or program teraination will close a file. 
Writs after rewind deletes any older file. 

11. Tha SAVE and LOAD consets are used for creating and 
resuming CISS SAVED files. 

12. Do not use //♦RAS, *RSS, *BS. 



Inferences 

Introduction to COMIT progr anining, HIT Press, 1962. 
CDMIT PrograBiner' s Reference Manual, MIT Eress, 1962. 
(N2W manuals for COHII II to be published shortly. Those 

contemplating immediate use can obtain preliminary namuals 
from V. H. Tngve, Graduate Library School, University of 
Chicago, Chicago, Illinois 60637.) 






D§.tailea_Descci£tion_o£_COMIT_CTSS_0£eration 

1 . Cofnand^COMIl 

The CTSS command COMIT ALPHA lakes the COMIX 

prograBiing language available to CTSS users. The 

pr^HTT e-v<^^<^'<< Ti r-nu-i i^orl i c: r" nm n?i t i h 1 f» ui th the SHARE 

distributed COMir II except for certain input- output 
functions. It is possible for a foreground user to 
write, compile, debug, and run a COMIT program directly 
froiB a console typewriter. 

Inp ut 

The COMIT input source program nay be composed at 
the typewriter using an edit command, or it may be 
loaded on the disk from cards, or it may be produced 
directly as the output of another CCBIT program. In 
any case it lust be named or renamed ALPHA CDMIT. 

Q 2£Ei.i.§.ii.SS. 

When the connnand has been issued, compilation 
basins. The title card may be omitted, but if present 
will be typed out as a check. There Is a comment at 
tha and of CDmpilation . The compiled program then 
begins to run under the COMIT interpreter. 

2 . CoBEJler Error Cjmmgnts 

Any compiler error comments are printed on the 
typewriter during compilation. You Bay push the break 
button twice at any time to quit and make corrections 
before recompiling. 

3. I nter^reter^ Err cr_ Comments 

Interpreter errors may occur at any time after 
coaFil**^ion is finished. In this case, too, the error 
comments appear on the typewriter. Soma interpreter 
errors cause the run to terminate, tut others that are 
less serious halt the program temporarily after typing 
the word BBEAK. The program is now in BREAK status, 
and various actions may be taken as indicated below 
under 5. 

a - Manual^ In terru&t 

Pressing the interrupt button once during 
compilation will have no effect except that the 
supervisor will destroy any information in the 
supervisor input- output buffer, then it will type INT. 
NO ACTION. But during interpretation, the supervisor 
will destroy the information in the buffars and then 



CTSS EPCGBAMMER'3 GUID£ Section AH.2.0U 9/66 



raturn control to the COM IT systeiB, which will 
eventually type BREAK, enter BREAK status, in which 
interpretatiaa is teefiporar ily halted, and await further 
instructions frcm the keyboari. If an EXECUTIVE comset 
is used, a restart will be given instead of the break. 
(Se€ below for description of restart.) 

5- BBEAK_Status 

When CCMIT is in EBE&K status, it expects one of 
the following instructions from the keyboard: 
TERMINATE, CONTINUE, RESTART, DUMP or a iacimal number. 
TERMINATE, CGMIINUE, RESTART, and DUMP may be 

abbreviated to their first letter. These instructions 
are explained below. 

TERMINATE Typing TERMINATE when COMIT is in the 
BREAK status will cause the COMIT 
program to terminate normally. Any 

accumulated format A partial lines of 
output being held in the COMIT buffers 
will be written out. 

CONTINUE Typing CONTINUE when COMIT is in the 
BREAK status will cause the COMIT 
program to continue in a normal fashion 
from where it was when BREAK status was 
entered. 

RESTART Typing RESTART when COMIT is in BBEAK 

status will cause the COMIT program to 
ga back to the second rule and continue 
from there in immune status, in which it 
is inmune to the manual BREAK signal 
until the COMIT END card is reached. At 
this point the COMIT program does not 
terminate, but instead it leaves immune 
status and continues normally from the 
point where it was when it entered BREAK 
status. 

This facility allows one to stop a COMIT 
program at any time to provide it with 
input, change the flow of control, enter 
cr leave a trace mode, take a dump, etc. 
Section 13 gives programming suggested 
for processing breaks. 

DUMP Typing DUMP when COMIT is in the BREAK 

status will cause a special built-in 
format-S differential dump called a 
COMDUMP on the output unit, normally the 
console. 



CTSS EBCGRAMMEH»5 «1I TTf <5oi-*-4«n » u .» n/i a ^/r t 



number lypiny a decimal number between 1 and 

(2**35 -1) will cause an overrule stop 
to occur after that number of rules have 
been executed, allowing dumps to be 
ta ke n , e tc . 

6. £2Ii§oie_IS£iit_ an d_ Cutout 

Output on the console typewriter 
can be produced ty the COttIT routing 
instruction *WAL or *HSL. 

Input from the typewriter keyboard 
can fce ottained ty * BCS , ♦BAB, *BrR, or 
*KSH. When the COM IT program reaches 
one of these instructions it will read 
from the supervisor typewriter input 
buffer. If the buffer is empty, the 
COMIT program will wait until the next 
carriage return, which enters material 
into the buffer. Because of this wait, 
it is a good plan to have the COMIT 
program type a cosnient just before 
entering the rule containing the read 
instruction so that the user will be 
alerted to the need for providing input. 

7 . Sim ul at ed_Ta£ es 

All other COMIT channels refer to 
the disk. It is here that most of the 
incompatibility with the standard 

SHARE-distributed COMIT is to be found. 
The disk routines provided by CTSS do 
UDt completely simulate tapes. File 

names are normally of form ALPHA CHANEL, 
but arbitrary names may be provided by 
COMS EI cards on which the twc words 
which normally have the form TAPE A6 or 
ONLINE PUNCH are treated as a file name. 
The special name /ON LINE/ is used for 
the remote console. 

Q* 5lE.il.iS.a_on_Disk 

Material can be written on the disk 
by using *WAX, *WSX, *MBX, where X is 
any letter except L or B . The material 
written cut appears in a file on the 
disk named X CHANEL. If there is no 
such file in the user's file directory, 
such a file is created and named 
automatically. If there already is a 



CTSS EBCGBAKKER'3 GU ICE Section AH. 2. OH S>/66 6 

file by this name, the material written 
cut is added to the enl of that file. 

9^ Readiii3_f rom_t he_D isk 

Material can be read from the disk 
by using *RCX, *RAX, *RSX, »BBX, or ♦RTX 
where X is any letter except L, B, or S. 
Ihe material to be read should exist in 
a file named X CBANEL. The first read 
instruction starts reading from the 
beginning of the file. There is normal 
COMIl behavior on reading the 

end-of-file except that the next read 
instruction after an end-of-file has 
been read starts reading froni the 
beginning of the file again. Note that 
channel K is no longer the input tape 
unless the input file has been split 
into a program file naiRed ALPHA COMIT 
and a data file named CHANEL K. 

1 . Closina_gyLt_D is k_F iles 

A disk file is either open for 
reading, open for writing, or closed. 
Only three files may be open at any 
time. A file can be closed out at any 
time by the COMIT instruction *RW, by 
♦ FH after writing, or by *XF after 
reading. Reading an end-of-file closes 
the file. At the end of the COttIT 
program, all open files are closed out. 
The first read after a file has been 
closed is from the beginning. Writing 

is always at the end of a file, except 
that the first write after a rewind will 
first delete the old file- Since there 
may be only one file with a given naae, 
end-of-file marks cannot be used for 
data separators. 

If you want to stop a program which 
is writing a file and preserve the file, 
do net use QDIT, but press the break 
batten once to get BREAK, then type 
TERMINATE. In this way the file will be 
closed . 

1 1. Cceatina_and_Restorina_SAVED_Files 

The SAVE and LOAD comsets may be 
used to create SAVED files containing 
COMIT programs and to restore any SAVED 



C'^'SS EECG HAMMER' 5 GUICE Section AHi2i0'4 9/66 7 

file. 

12. iiaitations 

The COMIT instructions ♦BS, *RSS, 
♦ RAS may not be used. 

To program an autoiBatic BREilK, use 
a conma as a dump request. The dump is 
not automatically given, but rather the 
program enters BREAK status so the dump, 
cr scaie ether action can be requested. 

Make liberal use of periods before 
rule names when left-halves are not 
expected to fail. If one does, a BREAK 
will occur, allowing for a duap. 

To process the RESTART after BREAK, 
use the following organization: 



COM 

♦ START 

♦ RESTART 
START ♦ 



BESIARI 

END 



BSD 
END 



(END) 



JC W K.JL <JH 



i^Sfitif icaticn 

DYNAMO - Model Simulation Language 
A. L. Pugh III 

Purposa 

DYNAMO is a computer program for translating mathematical 
models from an easy- to- understa nd notation into tabulated 
and plotted results. The models may be modeled on any 

dynamic feedback system sucrh as arises in business, 
acrononics, or engineering. The principal limitation on the 
model is that it be a continuous representation of the real 
world. As DYHAMO does not recognize individual items or 
events, models of job shops and the lilte cannot be tested. 
Parsons familiar with both digital and analogue computers 
will find that DYNAMO in m an j ways behaves more like an 
analogue than a digital computer. 

Baf arences 

P5[{Li?l3 fisarls Manual A. L. Pugh III, M. I. T. Press 

Industrial Dynamics Memo D-805 "Time Sharing DYNAMO User's 
Manual", A. L. Pugh HI 



Usa^a 



DYNAMO NAME1 



where NAM El is the name of the model to be run (with 

sacondacy name MADIRN), and P and R are optional (order is 

also optional). The effect of these letters is described 
balow. 

P-Pag.a_Ski£ 

If the particular console being used has been adjusted so 
that tha perforations are three lines above where the paper 
stops following a vertical form feed, this letter can be 
usad to cause DYNAMO to skip to the top of a page rather 
than leaving four blank lines between pages. 

R-Rernn 

This latter cause DYNAMO to skip immediately to the rerun, 
even though there is a SPEC card included in the model. 

Aftar all the runs and reruns have been processed by DYNAMO, 
the console operator is given the opportunity to specify 
additional reruns by typing the normal rerun information, 
with one exception. The RUN card, instead of preceding the 
rarun, follows the rerun information and signals DYNAMO to 
start to process that rerun. 



CTSS ERCGRAMMER»3 GUIDE Section AH. 2. 05 Page 2 



Whaii DYNAMO is expactiny this rerun information it will type 
out 

PLKASE TYPE CHANGES IF KEROH DESIBED 

The user types the cards for a rerun just as he would for a 
rarun with the regular version of DYHAflC. He does net have 
to specify the card number of the card he is chanying. Nor 
ioas ha have to wait for the conputer to type a card number 
or H as ha does when using the INPUT and EDIT conmands. The 
tab signifies a skip to Column 7. 

A feature of time sharing simplifies correcting typing 
errors. Should the user wish to delete a long line with 
several errors he may type a ? followed by a carriage return 
to start him at the beginning of a new line. 

If tha user does not wish to rerun his model he should type 

QUIT 

IE while DYNAMO is either printing or plotting the results 

of a run the user decides that he does not want any further 

output but would like to skip on to the next rerun, he may 

press the break button once and DYNAMO will proceed 
immediately to the rerun. 

Dif ferences_In_In£Ut 

Basically the input to the lime Sharing DYNAMO is the same 
as the regular DYNAMO. There are several minor restrictions 
which are introduced by the time-sharing system while other 
restrictions have been removed. 

1. As one has access to this model only through 
the console, the option to number the cards of 
a model now becomes a requirement. 

2. A continuation card has a different card 
number rather than having the same number as 
the card it continues. 

3. The contents of the identification card (the 
first card) are entirely optional. Columns 7 
through 36 of this card are copied into the 
page heading. 

H. The RUN card which is normally the second card 
is now optional, 

5. The BUN number should be restricted to 5 
instead 6 characters. 

6. Because of the narrower page only nine columns 
are available for tabulating results instead 
of the former fourteen. 



(END) 



nil ml? Qar'-Unn ktt 7 Ci fi Parifi 



I dent if icaticn 

ESL display system (n3t a comiaand) 
C. Garman 

Purpose 

To provida a graphical input and output facility with a 
limited real-time capability. Two 18 inch CRT'S are 

providad for output. Input is from light pens, 

pushbuttons,, toggle switch banks, and other forms of 
analogue input. Heal time rotation, translation, and 
magnification of appropriately constructed pictures is 
possibls under pragram control. 

E^f 3£3Il£es 

MAC 122 DEMON; E3 L Eisplay Console Demonstration Polansky 

Pragcam 

MAC 125 ESL Display console Time Studies Polansky 

MAC 166 B-ccre system for programming ESI in CTSS Lang 

MAC 201 ESL Display console system manual Bayles 

MAC 202 Proposal to improve rotation matrix of ESL Stotz 

MAC 217 Operating Manual for the ESL Display Console Stotz, 



Ward 

(END) 



r<r>cc oonnohMMVa t <i f:iiTnP c:c»<-4-ir»n iH'Pn? 19yf.Q 



Identification 

FAP - IBK 7094 Machine language 
Programraing Staff 

Purfiosa 

FAP is the lEM MACBO-FAP assembly program for the 7094 
Hiachine language cede, slightly modified for increased 
utility. It accepts all 7094 operation codes and the 
standard data-defining pseudo-operations, as well as macro 
lafinitions. Input files may fce line marked (tabs are 
assumed set at columns 8, 16, 30, and all columns 
thareafter; lines are truncated after column 72) or 
line-numtered, 

IBM C28-6235 Fortran II Assembly Program (FAP) 

ysa^e 

FAP namel -name2- -list- 

•namel name2» is the name of the file to be assesfbled 
• name2' is assumed 'FAP* if not specified 
»list« consists of any of 

• (DATE) -M0-» print date and time of assembly in page 

headings 

• (HACB) -NO-* macro nesting level will be listed and 

multiply defined macros will be flagged 
' (LIST) -N0-* create 'namel BCD', the listing file 

• (FLAG) -N0-» list non fatal flags on the user's 

console 
' (REFS) -NO-' force symbolic reference listing 
»(LCNG) • # set page length to #; default value is 

56, mininuD is 4. the maximun number 
Df referen:;es per line in the symbolic 
reference listing is reduced by three. 
this is intended for producing listings 
that will be reduced to 8 1/2" by 11". 
'BCD -NO-' sane as '(LIST) ' 

'SO' inverts the meaning of the argument it is 

applied to 

The default mode is (CATE) (MACR) (LIST) NC (FLAG) 

General 

CTSS FAP is completely ccBfatible with FAP as described in 
IBM C28-6235 except that, since it is not useful in the CTSS 
environment, the UPDATE facility has bean removed. These 

psa udo-operations will be listed with a non- fatal 'F' flag 
but will have no other effect. It accepts the standard 7094 
BCD character set plus the chacactars 'colon' (octal 35) and 



CTSS PH0G8AMMES*S GUIDE Section AH. 2-07 12/69 2 

'tab' (octal 72). Cclon is an alphabetic character; tabs 
ara converted intD strings of spaces by the preprocessor. 
Tab settings are at columns 8, 16, 30, and every colunin 
thereafter . 

CTSS FflF ases temporary files with first names 'FAPTEtt', 
•FAPSYM', 'FAPBSS', and (if a listing is requested) 
'FAPBCD'. The second name of any of these files is the 
aser's progranmer nuirber. A symbol table file 'namel SYMTB' 
is created which contains all defined symbols with their 
definitions and relocation information. The format is BCD 
carl-image with four fields of three words each and two 
words of trailing blanks per card. Each field has the 

format VVVVVV bRbSSS SSSbbb. VVVVV? is the symbol value 
with one leading blank if < 32768, SSSSSS is the 
left-adjusted symbol name, and K is if absolute, 1 if 
ralocatable, 2 if cammon, and H (actually 5) if in the 
transfer vector. This file is used by debugging aids such 
iS DEBUG (Sect. AH. 8.08) . 

If no page title card appears in the first card group, a 
Isfault header of 

FAP ASSEMBLY LIS3INS FILE namel name2 

will be used. The date and time of assembly are normally 
listed to the left of the page number at the top cf each 
page. Two new ncn-fatal error conditions have been defined 
to flag common errors: 'L* if the location field is numeric 
when a symbol is expected, and '7» if column 7 is non-blank. 
A new form of literal has been defined: =V adds the 

versatility cf the VFD pse ud o- opera ti on to literals. The 

string following =V is processed like the variable field of 
an OFVFD (only previously defined absolute symbols may be 
raf aranced, the result may net be mora than 36 bits long). 
No tag or decraoient is allowed in an instruction containing 
a VFD literal. 

M^ching__Q£erat4.0BS 

Six naw extended nachine operations have teen defined, three 
for use in calling sequences and three for use in I/O lists: 

as requires 

Address 

Tag 

Address, Decrement 

Address, Decrement 

Decrement 



mnemonic 


meaning a 


ssembles 


PAR 


parameter 


TXH 


EFA € 


jffective address 


NOP 


ELK 


block 


TIX 


lOP 


I/O Proceed 


TIX 


ION 


I/O Ncn-transmit 


TXI 


10 D 


I/O Disconnect 


PZE 



CTSS EPCGRAMMEB'S GUIDE 



Section AH-2.n7 



i:>yfiq 



Soma naw machine aperations relating to special time- sharing 
hardware have been defined: 



mnemonic 

LRI 
SBI 
LPI 
SPI 
. TIA 

TIB 

SEA 
SEB 
IFT 

EFT 

SSLx 

PSLx 

SCDx 



function 

Lead Relocaticn Indii^ators 
Store Relocation Indicators 
Lead Protect Indicators 
Store Pratect Indicators 
set instruction references to 

A-core and transfer 
set instruction references to 

B-ccre and transfer 
set data references to A-core 
set data references to B-core 
skip if instruction references 

are in A-core 
skip if data references 

are in A-core 
Store Sense Lines - channel x 

Present Sense Lines - channel x 

Store Channel Diagnostic 
- channel x 



op. code 



0562 


X I 


0601 


X I 


0564 


X I 


0604 


X I 


0101 


X I 



-0101 



-0761 0044 



+0660 


+ 066 1 


+0662 


+0663 


+0664 


+0665 


+0666 


+ 0667 


+0644 


+ 0645 


+0646 


+0647 



X I 



0761 


0041 


X 


0761 


0042 


X 


0761 


0043 


X 



X I 



X I 



X I 



3^ mbol-def ininq Pseudoj^ 21® i§. lions 

SETB: This pseudo-operation is provided to give a symbol a 
boolean definition and yet permit redefinition. It sets 
the symbol in the location field to the value of the 
boolean expression in the variable field. If the symbol 
had been previously define! by a SET or SETB it will be 
redefined; if it was previously defined in any other 
manner it will be redefined but a warning flag will be 
genarated. All symbols used in the variable field must 
have been previously defined. 

Storaqa-allocating Pseudg^OBgr ations 

COWBSS and CCMBES have been provided to allow more 
intelligible use of coaiBcn. 

CDMBSS: The coBmcn counter ie decremented by the value of 
the expression in the location field; then the syBbol, if 
any, in the location field is defined as the value of the 
common counter plus one. This is analogous to the BSS 
pseudc- operation. 

COMBES: The symbol, if any, in the location fiald is defined 
as the value of the common counter plus one; then the 
common counter is decremented by the value of the 
expression in the variable field. This is analogous to 
the BES pseudo-operation. 



CTSS PaOGRAMMER'S GDIDE Section AH-2.07 12/69 4 

Data- (^e n era tina_Pseudo- operations 

BCI and BCD have been modified and 12BIT (to generate 
<: ,,1 1 _n,^-ip *-ax^ inf Trraa*- i nn^ Vias been added. As used herein, 
"quoted text string" ireans "/text/" where V" is any 
character except blank. Any character except ••/" may appear 
within the string. 

BCI- The variable field may contain a quoted text string 
beginning in calumns 12 through 16 and fcllcwed 
ininediately by a blanTt or column 73. The characters an 
the string are converted to BCD and stored six to a word 
in consecutive tneaory locations. If the nuEber of 

characters is not a multiple of six, the last word is 
padded to six characters with nulls (octal 57). The 

algorithm for deciding whether the variable field is a 
qoutad text string or a word count plus data is: 

1) the first two characters are 1-9 followed by a 
comma -- count and data 

2) there is a coiEma in column 12 — count and data 

3) the first and last non-blank characters are the 
same -- quoted text string 

4) the first character is 1-9 — count and data (gives 
non-fatal 'f flag) 

5) otherwise -- gives fatal »E« flag (one word of 
blanks is assembled) 

BCD: is like BCI except that the quoted text string must 
start in column 12. 

12BIT: This pseudo-operation is used to generate full-mode 
text information in a program. A symbol in the location 
fiald will be defined as the next location to be assigned 
when the 12BI!I pseudc- opera tion is encountered. The 

variable field contains a quoted text string beginning xn 
columns 12 through 16 and immediately followed by a blank 
or column 7 3. The characters in the string are converted 
to their octal values in the CTSS character set (Sect. 
AC. 2. 01), packed three to a word, and stored in 
consecutive memory locations. If the length of the 

string is not a multiple of three, the last word will be 
padded to three characters with nulls (octal 0057). 
Letters are normally lower case. The character "*•• is 
special: its code is not assembled but the 100 (base 8) 
bit of the code for the next character in the string is 
complemented; this creates upper case letters frcD lower 
case ones and some special characters from numbers and 
BCD special characters. All 6-bit characters except ••• 
and most 12-bit characters can be produced. 



rTQ c: vvrr.T) hMnwa* c: nnrrr t:or-*-inn ah 7 07 19/Aa 



P^gggggr JJ^Pl^iD^ .Sjseudo-gfera tions 

LISK and NOLNK are provided to ::ontrol the existence of 
tha linkaje director. 

LINK: The variable field must contain either *3N' or 'OFF'. 
•ON' will caase the linkage director to be included in 
this subprogram, 'OFF' will delete it. 

NOLNK: This is an obsolete form retained for compatibility. 
It is equivalent to 'LINK OFF'. 

List__CQntrol Pseudo-operations 

These pseudo- opera tions affect the listing (if any) and 
tha tarminal output but have no effect on the binary output. 

FLAS: The variable field must contain • Cfc' or 'OFF', 'ON' 

rausas non-fatal error flags to te listed on the 

terainal, 'OFF' causes these flags to appear only in the 

listing. '08' is the default mode. If ' (FLAG)' appears 
in the coffBiand line, this operation does nothing. 

LSTNG: Alternate occurrences of this pseudo-operation cause 
initiation and ternination of printing the listing on the 
user's ternrinal. 

MLEVEL: The Variable field tntst contain 'OH' or 'OFF'. This 
pseudo-operation cantrols the appearance of the macro 
nesting depth to the right of a macro expansion. If 

'(BACB)* appears in the command line, this operation has 
no effect. 

MMACBO: The variable field must contain 'ON* or 'OFF'. This 
pseudo-operation controls the flagging of macro 
re-dafinltions (in the listing and at the terminal). The 
mode is initially on. If ' (BACR) • appears in the command 
line, this operation has no effect. 

RKF: The pseudo-cp has been modified to accept a variable 
field. The variable field may be blank or may be any FAP 
expression (blank = 0). Ihe variable field is evaluated, 
and its value is interpreted as follows: 

All symbolic reference listings are deleted (except 
multiply defined symbols) 

1 Listing of unreferenced symbols is suspended 

2 Listing 3f unr eferen:;ea nonrelocatabla symbols is 
suspended 

3 or more (e.g. -1) Normal moda of symbolic reference 
listings 

If '(REFS)' is specified on the command: line, this 
pseudoop has n3 effect. 



CTSS PHOGRAMMER'S 3UIDE Section AH. 2. 07 12/69 



SYMREF: The variable field may be 'CN', 'CPF', or blank. 
This pseudo-op controls the accumulation of symbclic 
references. Normal racde is ON ; blank variable field 
inverts the laode = 

SRQ: The variable field must contain * CN« or 'OFF'. This 

controls sequence checking of card-image input. Checking 
is initially on. 

NDSEQ: This is an obsolete fern retained for compatibility. 
It is equivalent to 'SEQ OFF', 

Macro. Processor 

HACROH: This pseudo- opera tion is identical to •MACRO* except 
that unspecified trailing arguments will never be 
replaced by created symbols. 

SAVCBS: The current created symbol count and character are 

saved. 
RESCPS: The created symbol count and character are restored 

to what they were when the most recent SAVCRS was 

encountered. N.E. SAVCRS/KESCRS pairs can not be 

nested, 

BCORE: This pseudo-operation indicates that this program is 
to be run as background to CTSS. It will be checked for 
illegal instructions and the B-core flag will be set in 
all I/O ccffmands. 

ACORE: Counteracts a previous 'BCORE'. 

INSERT: The variable field contains one or two file names 
separated by a commd. The entire contents of the named 
file replace this pseudo-operation. If name2 of the file 
is not specified, it will be taken to be the same as the 
second name from the command line. IJtSEFTs nay not be 
nested. The INSERIed file need not te the same type 
(line-marked or cacd-image) as the current source file. 

ABBREV: The variable field may contain 'CECCDE' or 'SYHEOL*. 
'OPCODE' will cause over UOO operations not generally 
useful in foreground programs to be deleted from the 
combined operatians table. This more than doubles the 
number of available slots- 'SYMBCL' is intended to 

remove all created symbols from the symbol table. It 

will delete any five chara::ter symbol beginning with a 
'.'. This operation is effective only during pass 1. 

SAVE: The variable field contains one or two file names 
separated by a CDmma- This operation is intended to 
create private versions of FAP that have been initialized 
with macro and symbol definitions, etc. When encountered 



>-m t^-r r\rTi 



CTSS PHUIiKftnotK ■ ^> JUJ.L»> 



o-^ '^ ♦■ 1 r\rt 



a H '.) . t) 7 



12/69 



during pass 1, this causes loss of all ganerated code 
than Lies itself as the first file na«e specified When 
resumed, this saved file -ill act like FAP except that it 
will retain all symbol and macro definitions, mode 
settings, and unexpanded remote sequences. Preset modes 
„ay be overridden by arguments when resumed or by 

■' .■ •_ ^i-„ fiio ♦■r. ho >».c;c:pnihled. The assumea 

second na»e of input files will be set to the second name 
specified by the SAVE, or, if none, to the first. 



(END) 



rTc;c; pRraRAMMKR* s RUICE Sectioti AH, 2. 08 Faqe 1 



GPSS - General Purpose System Simulator 
M. M. Jones 

Purposa 

GPSS is a siBUlation language that is easy to learn, use and 
i:»bug. It autoaatically collects and prints many useful 
statistics. GPSS is particulary well suited for simulation 
of traffic flow models, such as communication nets, circuit 
models, computer systems, and queuing models. 

HAC 140 On-line Version of GPSS II M. K. Jones 

IBM B20-6346 General Purpose System Simulator II 



(END) 



.....r,,..,- ^.iTnc o£>,.+ ;rtn &H 9 nq '//(id 1 



LISP - List Processiny Language 

J. HOS3S 

Pur£Ose 

LISP is a high-level list processing language, matbeaiatical 
in character. PrDgcams specify computation by recursive 
functions. The time-sharing version contaxns functioas which 
permit smooth interaction between LISP and the time- sharing 
environment. The language is used extensively in artificial 
intelligence work. 

MIT Press LISP Proga mtner 's Manual Levin 

Information The Programming Language Bobrow, 

Internaticnal 'LISP- Berkeley 

MAC 13U LISP £xercises Hart 

MAC 153 rime Sharing LISP Martin, Hart 

MAC 206 CISS LISP NOTICE Hart 

MAC 296 A New Version of CTSS LISP Fenichel, Moses 



Usa^e 



LISP -NAME1- 

NAME1 LISP is a ECE file containing pairs of 
S-expressicns which will be initially read and 
executed by the LISP evalquote operator- If 

NAME1 is net specified. LISTEN NIL will be 
executed . 

LISTEN NIL -- If the doublet LISTEN NIL is executed, 
subsequent s-expr ess ions will be read froa the 
console. When the atomic symbol STOP it* 
typed, the system will normally enter the 
DORMANT state. 



(END) 



r"Ti^<^ ERrfiRiMM ppt «; nnrnp <;or-fir.n AH_9.in rt/f;^ 



liSfliifi cation 

HRD - Michigan Algorithm Decodec 

Univeusity of Michigan; E. Arden, B. Galler, and B. Gcaham 

Prograniniing Staff 

Purpose 

MAD translates algebraic statements describing algorithms 
into the equivalent machine instructions. The MAD language 
wis originally based on ALGOL 58 with certain extensions and 
adaptations. It allows seme more powerful logical operations 
than Fortran II. 

B^E stances 

MAD Ncvember 1963 (Reference Manual) 
MAD December 1 96U (Reference Manual) 
CC 186 Fortran 5 MAD format Specifications Spall 

CC 213 Abbreviated MAD Corbato. . etc. 

HESTRICTig«S 

The extended features in the appendix of the December 196U 
roiQual have not been implemented. 

Usa-is 

Tha current compiler implements the language as described in 
the MAD Manual of November 1963. However, a few additions 
and modifications have been made. 

MAE NAME1 -• (LIST)'- -• (SYMB)»- 

NAMEI is the primary name of the source file NAHEl 
MAD which is to be translated. 

(LIST) requests that MAD create a line-marked 

listing file called NAME1 BCD which may be 

PBINTed on-line or RQUEST PRIST for off-line 
printing. 

(SYMB) requests that MAD produce a special symbol 
table named NAMEl SYMTAB which is used by 
MADBUS. (SYMB) also suppresses the normal 
3n-line printing of length, entry point and 
transfer vector length. 

CHANGES: 

1. A new statement 

INSERT FILE ALPHA 
will cause file ALPHA MAD to be inserted in the 
ccirpilaticn after the INSERT FILE statement. Only 



CTSS FBCGBAHMER'3 GUIDE Section AH. 2, 10 8/65 2 



one level of nesting depth of inserted files is 
allowed, although any number of INSERT statements 
may appear in the higher level program. 

2. An addition has been made to the ♦...» block 
notation in MAE. Formerly only the foria 

A. ..6 or A,..., B 
was allowed, where A and B are variables. How the 
second expression ma y be a constant, e.g., 

A ... 7. 
See «AD Manual, November, 1963, page 16. 

3. A change has been made in HAD for defined 

operators. (See MAD Manual, Sovembar 1963, pages 

100-112.) This was needed due to the added feature 

cf saving and restoring index registers 1,2 and U 

in functions. The change was made to the ..RTN. 

operator. Ihis is now a unary operator, i.e. only 

a E operand. The function of the B operand renains 

the sane, that is, the address of the value to be 

returned to the calling prograo. The A operand is 

internally set to the address of the index 

restoring code. This address is designated "FF". 

Note the example on pages 110-111 of the November 

1963 manual. This should be changed to the 

following : 

..RTN. This symbol, which is obviously 
invalid in a statement, stands for the 
operation of placing the appropriate value (s) 
in the arithmetic register (s) and then 
returning from a function to its calling 
program. It is analogous to the right hand 
side 3f a substitution statement (the B 
operand) and then a transfer to a given 
address (there is no designation for this 
address within the triple). As such, there 
is no cesultT As~an example, if the result of 
a function were a double precision number, 
say mode 5, tha following would be a 
reasonable definition. 

MODE STRUCTURE U..RT8.5 

JMP ♦♦3,BT,*+1 

CLA E 

LDQ B+ 1 

TRA FF 

OUT A2Q 

END 

The address FF is the address of the index 
restoring code. 



^or'firiTi ftH-?.10 fi/feS 



The input phase of M&D has been rewritten to use 
the new file system and accept line- narked 
(SQUASHed) files as well as card-image files as 
input. Any mixture of line-narked or card-image 
files may be used, e.g. INSEai FILE statement may 
insert the opposite kind of file from the main 
file. 

On a line- marked file, the tab and logical 
backspace will be interpreted as fellows: 

a. A logical backspace (colon) will imply a 
backspace to column 11 onl^ if the colon 
occurs in column 12. (See b. below) . All 
other colons will be treated as legal 
characters ty the input routine. 

b. The first occurrence of a tab effectively 
indicates that the following characters must 
start at least in column 12. Should the 
first tab occur after column 12, one blank 
will be inserted. 

c. Further occurrences of tabs are interpreted 
to mean that the following characters are to 
be at least 5 columns away from the column 
reached by the last tab. This allows one to 
indent HHENEVEB's, etc. 

The input phase will construct a sequence number 
for internally generated card-images constructed 
for line-marked records. This number will be 

incremented by 1 for each line-marked record read. 
The sequence numbers should provide an aid to 
error checking and correction using EDL. 



(END) 



n. »U O 11 Dand 



Identif icaticji 

MADTBN - Fortran II to MAD translator 
Programming staff. 

Purpose 

Fortran II has not been implemented to operate with the 
time-sharing system. In order to allow users to operate with 
Fortran II prograas, the MAETRN translator is provided. A 

Fortran II source language program may be translated to MAD 
ani than translated tD the equivalent machine instructions 
by the MAD ccnipiler. MADTRN does not always produce perfect 
results and, therefore, should not te used unless absolutely 
necessary. MADTBN assumes a working Fortran program and 
therefore MADTKN diagnostics are minimal. 



R2f trances 



IdM 

CC 

cc 


18B 
186 


Fortran 
MACTBM, 
Fortran 



Reference Manual 

A F3rtran-To-Mad Language Translator Korn 

and MAD Format Specif cations Spall 



Uiia^e 



MADTRN KAME1 OP 

SAMEl is the primary name of the source language 
file named NAME! MADTRN or I.AME1 OP if OP is a 
class name. 

0F= (LIST) The argument (LIST) will be passed on to the 
MAD compiler and the listing file named NAME1 
BCD will be created by MAD. 

OP = (SYMB) The argunent (SYMB) will be passed on to the 
MAC compiler and the file NAMEl SYMTAB will be 
produced to be used by MADBUG, 



(END) 



r^riTnP t:ar-+i r.n A R "5 1 9 S / ft fi 



I^Sfitif icaticn 

SNOBCL - A String Manipulation Language 
D. Shea 

Pur£03e 

SNOBGL is a programming language for the manipulation of 
strings of symbols. A statement in the SNOBCL language 
:;onsists of a rule which operates on symbolically named 
strings. Ihe basic operations are: string formation, 

pattern matching, and replacements. Facilities for integer 
arithmetic, indirect referencing, input-output, debugging, 
and SNCBCL -coded and SNOiJOL system functions are included. 

ysa3.e 

SNOBOL MAME1 -•ONLINE»- 

will initiate action (compilation and execution) by the 

SNOBCL compiler on the line-marked file NASEI SNOBOL. The 

SNOBOL program listing, and ether compiler output, will be 
put in a file named NAMEl BCD. 

ONLINE is an optional argument which causes all output to be 

printed cut on the user's console. It may be abbreviated 
•o», 

Rgf arances 

Journal of the ACM, January 196U, pp. 21-30. 

CC 235, KAC-M-307, CTSS SNOBOL User's Manual, Shea. 



(END) 



rTtIc: PRfJCRA MMRR » <; nilTDF Sfarrtion flH-^.lS 1/f>ft 



I iSfitifi cation 

3PS - On-line prcgraBming system 
M. Jonas, J. Morris, D. Ness 

Pur£os3 

OPS is a sub-systeir intended to facilitate on-line 
interaction between a computer and the general user. It 

allows leading, execution, and deletion of ESS subroutines 
by nams and construction of FOBTHAN-like procedures. A 

large repertoire of standard operators (subroutines) is 
available for data manipulation and simulation. 

M. Greenberger, et. al., Qn-Line Comgutation and Simulationj. 
The OPS-3 System, The Mil Press, December 1965. 

MAC-H-277. CPS-3 Goes Public. Greenberger, Jones, Ness, 
Morris. 

Usa^e 

Th3 sub-system is entered by typing (at command level) 

OPS 

CTSS will respond with a system W ( ait) line; then OPS will 
respond with a line beginning "OK". Thereafter, typing the 
nima of a subroutine causes its execution. In particular, 
typing 

GUIDE INFORM 

will introduce the new user to the guide files and their use 
in obtaining information about the system. 



(END) 



r:iiTrF <<e-n*-inn AH, 2. 16 12/69 1 



liantif ication 

Information Retrieval and Text Management 

TIP 

W. D. Mathews, Project TIP, Rm. 14S-310, X5687 

Pn r nose 

TIP is a flexible and powerful information handling system 
developed by the Technical Information Program to provide 
zrapabilities for information retrieval and text Bianipula tion 
in a wide variety of on-line applications. The command and 
the many associated subsystems are described in the 
docuaants listed below. These publications and additional 
information are available from: 

Project TIP Document Room 

Boom 14S-310 

Massachusetts Institute of Technology 

Cambridge, Massachusetts 02139 

5 =.£=.£3 nee s 

TIP-TM-1C4 The IIP Reference Manual 
TIP-TM-105 The Edit Reference Manual 
TIP-TH-1G6 The Reduce, Expand, Sort 

and Merge Reference Manual 
TTP-TM-1C7 A TIP Sampler 
TIP-TM-111 The Bun Reference Manual 



H. 


D. 


Mathews 


L. 


H, 


Morton 


E. 


M. 


MattisoD 


J. 


B. 


Ebright 


H. 


I. 


Nissen, Jr 



(END) 



CTSS FPCGRAMMEfi'S GUIDE Section AH. 2. 17 3/66 1 



Il§.Ilii.£.i.£iti2Q. 

FORTRAN IV Translator F0R4 
T. Burhoe, 868-9840 

Purpose 

To translate source programs written in the FOBTRAS IV 
language to WAD and compile them; to provide source- level 
compatibility between CTSS and background FCfiTRAN IV; and to 
provide useful diagnostics on the source program, 

FORI is an author-maintained CTSS command, offered on an 
experimental basis. As such, all inguiries, suggestions, or 
complaints should be addressed to Mr. Tom Burhce, IBM 
Scientific Center, 5U5 Technology Square ( ^th floor) , 
Cambridge, Mass. Telephone (61 7) -868-98U0. 



Usag.e 



F0R4 NAME -•NOCOMP'- -•BADFIL* 



NAME is the primary name of file NAME MADTBN, the 
usar's FORTRAN IV source program. It must be a line- numbered 
disk file. All source programs should be written in 
a:;cordanca with the FORTRAN IV language specifications as 
described in IBM Forn C28-6390-2, available at the Ccop. 
These are the specifications for FORTRAN IV as implemented 
under IBSYS, Version 13. 

fiOCOME is an optional parameter indicating that the 
user does not wish the translated MAD program to be compiled 
into object code, (For instance, he may wish only to find 
the syntactic errors in his FORTRAN programs prior to 
submitting them for background runs.) 

MADFIL is an jptional parameter indicating that the 
generated MAD program should be left in permanent (C) mode 
in the user's directory, rather than in temporary mode as in 
the normal case. Also, detection of source errors will 
normally suspend the generation of further MAD code; the 
HADFIL option will create a MAD program regardless of errors 
in the source program. 

In normal operation, F0R4 will generate an eguivalent MAD 
program in temporary mode, compile it via MAD, and exit to 
CHNCCM. If source errors are detected, they are printed out 
along with the offending statements, and the final exit is 
to DEAD. If translation is interrupted via the BREAK key, an 
immediate exit to CHN30M will occur. 



CrSS EBCGRAMMJiR'3 GUICE Section AH. 2. 17 3/66 2 

Thara dre nearly aae hundced explicit one- line diagnostics 
in FORU, thus permitting much flexibility and specificity in 
h:ilpin;j the user debug his programs. The diagnostics closely 
resemble these of IBSYS FORTRAN iv^ One important objective 
oE^ FORU is to permit an exact correspondence between 
programs which will compile and run under CTSS, and those 
whiah are run under batch processing- Thus, all lESYS 
FORTRAN IV errors are diagnosed in FORU, even though some 
may be "translatable" - e.g., mixed modes in arithmetic 
a xpressions. 

Th3 so-called "built-in functions" of FORTRAN IV may be used 
in Foau in external function form by including file 'F4LIBE 
BSS' at load time. Ihi/s program contains entries for all 
the built-in functions which do not process "complex" or 
"ioubla-precision" data exclusively. To link to this 
(1-track) library, do: LINK F1LIBE BSS M1416 CHFLOU . 

Restrictions 

Because of dependence on the IB JOB system, or lack of a MAD 
::ountarpart, the follswing FORTRAH IV facilities may not be 
used in F0H4: 

•BLOCK DATA' subprograms 

•DOUBLE PRECISION' and 'DOUBLE PRECISION F0HCTION» 

•COMPLEX' and 'COMPLEX FUNCTICS' 

«NAMELI3T» 

Named-common conventions in •CCBHCli' declarations 

• E NT BY » 

•RETURN i» (ncn-standard return) 

Attempts to use these facilities will cause a special 
diagnostic to the user reminding him that they ate legal in 
IBSYS FCBIRAN IV, but cannct be processed by FORU. In 
addition, the user should note the inconsistency in array 
storage between FORTRAN and MAD, the former storing by 
columns and the latter by rows. Thus, an attempt to 
aguivalance a vector to a column of a matrix would be 
acceptable in FORTRAN, but the resulting PAD program would 
hiV3 the vector eguivalenced to all or part of one or more 
rows of the matrix. Care is urged in this usage of FORU. 

All facilities of FORTRAN IV excepting those noted above are 
available to users in their full generality. 



(END 



CTSS PROGRAMHEB'S GUIDE Section AH. 2. 18 3/66 1 



t^^ntif icat^icn 

An Aljabraic Desk Calculator version of the Formula 

Manipulation Compiler developed by the IBC Boston 

Programming Center. 

F3RMAC 

R. Kenney, aS1-C321 

Purpose 

To allow the user to manipulate a class of formal 
expressions and compute the values of arithmetic 
expressions. Included among the capabilities of the program 
are formal differentiation, substitution for one or more 
variables in an expression and expansion of expressions. 
Aftar the expression has been manipulated in a way requested 
by the user, the results are simplified; like terms (i.e., 
terms which differ only by a constant factor) are combined, 
zaro terms and unit factors are eliminated, etc. The result 
of the computation or manipulation is then available for 
furthar manipulation or for printing on the user's console. 

FORMAC is an author -maintained CTSS command offered on an 
experimental basis. Inquiries, suggestions or comments 

should be addressed to Mr. Robert Kenney, IBM Boston 
Programming Center, 545 Technology Square (3rd Fleer), 
Cambridge, Massachusetts, telephone (617) U91-0321. 

R2f arence 

CC-257. Description of lime-Shared FORKAC. 

Hathod 

Tha Dask Calculator statements are executed immediately, as 
they are typed in through the user's console. No provision 
is made for a stored program. That is, although results are 
saved and are usable fcoro one computation to the next, the 
statemants which caused the computations to take place are 
not saved. Thus, it is not possible to establish loop 
controls and various paths of program flow in the classical 
stored program sense. 

The Dask Calculator accepts lines of up to 84 characters and 
prints 84 characters per line. The »$• is used as the end 
oC statamant marker, A statement may extend over any number 
of lines. FORMAC will respond •READY* initially and between 
statemants; do not type a new statement until the response 
has appeared. (Editor's note: If the response seems unduly 
dalayad, check to see if you've forgotten to terminate the 
statement with a •$'.) Standard CTSS erase and kill 

characters apply during the typing of a line. However, 

thara is no "context editing"; if an already typed line is 
found to be incorrect, the entire line must be retyped. 



CTSS EBCGHAKMfcR'3 GUIDE Section AH. 2. Id 3/66 2 

Usacje 

FORMAC 
Sammary (see CC-257 for details): 

Variables: 

A variable name represents a fixed point variable if its 
initial character is Dne of the letters I-N . A variable is 
made either atomic or assigned from context , "upon its 
first appaarance" in a PORMAC statement. It is considered 
"assigned" if its first appearance is on the left-hand side 
of an = sign. It is "atomic" (i.e., it stands for itself) 
if its first appearance is on the right hand side of an = 
sign. An atomic variable may not have an expression 
assigned to it. 

Operators and Functions: 

Expressions may be composed of the following operators and 
f unctions : 

♦,+,-#**»/» DERIV,SIH,COS,ATN,HTN,FAC,EXPCN,LOG,DFC,COME. 

DERIV (A,B,N) is the nth derivative of A with 

respect to B, 

SIN (A) is the SINE of expression A. 

CCS (A) is the COSIME of expression A. 

ATN (A) is the ARC TANGENT of expression A. 

HTN (A) is the HYPERBOLIC TANGENT of ex- 
pression A. 

LOG (A) is the NATURAL ICG of expression A. 

EXrON (A) is E**A. 

FAC (A) is the FACTORIAL of A. 

DFC (A) is the DOUBLE FACTORIAL of A 

(n(n-2) (n-U) ,.,) . 

COMB (A,E) is the CO HBINATCBIA 1 of A things 

taken B at a time. 

Executable Commands: 

The assignment statement assigns the variable name on the 

laft of the equal sign as the name of the expression on the 

right. The expression may be composed of any of the 
operators and functions above. 

Example: A = E + C + EERIV {X*»2,X,1)$ 
Result: the variable A names the expression, 
B+C+X*2. 

SUBST Substitution for variables in the expression. The 
list of parameters may he written explicitly or a 



CTS.S PROaRAMMRR • <^ ntimF ^P»r-tir>n AH .P 1H ^/AA 



label of a 'PARAM* statement may be used. 
Substitution proceeds from left to right. 

Example 1: D = SUBST A, (X, 0) $ 
Example 2: ABC = PARAM (X,0)$ 
D = SUBST A, ABC$ 

Result: Both examples result in D naming the 
expression B+C. 

(Assume A was the expression B+C+X*2 
from the example above.) 

EXPAND Performs multinomial expansion and the distribu- 

ive law on the expression. The ' CODEM* option 

causes the result to be placed over a common 
denominator. 

Example 1: F = EXPAND D**2J 

Result: F names the expression B**2+B*C2+C**\ 

(Assume D was the expression B + C from 

above. ) 

Example 2: F = EXPAND H/B+C, CODEM$ 
Result: F names the expression: 

(B*C + H)*B** (- 1) 

PRINT Prints on the user's console the variables and 

their expressions nhich are specified. 

Example: PRINT A ,D$ 

Result: Results in the following print-out on 

the console, 

A = E+C$ 

D = B**2+B*C*2+C**2$ 

DUMP Prints on the user's console all assigned 

variables and their expressions. 

Example: EUNPS 

Result: All assigned variables printed in the 

same format as the •PRINT* command 

above. 

ERASE Erase the expressions specified and return the 

storage they require to the storage pool- 
Example: ERASE A, C$ 

Result: The expressions which A and D names 
ace erased. 

CLEAR Clears the symbol table and reinitializes the 

storage fccl. It has the same effect as reloading 
the Desk Calculator. 



CTSS 



GUIDE Section AH. 2. 18 3/66 



Example: CLEARS 

Besult: All symbols removed from the symbol 

table and the storage pool 

reinit ialized* 

STOP Places the Desk Calculator in dead status and 

returns to the CTSS supervisor. 

Example: STOPS 
Fesult: B XXX.X+XXX.X 

Declarative Statements: 

DEPEND Declares dependence relationships between atomic 

variables for use with the differentiation 
operator - 

Example: EEPIHD (M,B/X,X)$ 

Besult: n depends on X and Y, B also depends on 

X and Y. 

(NOTE: M does not depend on B nor X or 

Y or Y on « or b.) 

Example: DEPEUD (X/Y) 

A =DiRIV (X**2,Y, 1) $ 
Result: A names the expression: 

2*X*EERIV (X, (Y, 1) ) 

PARAM Sets up parameter pairs for use with the •SUBST* 

cosmand. 

Example: ABC = PARAM (B,2), (C,X+Y)$ 
Besult: When the label ABC is referenced in the 
•SUBST' command, the number 2 will be 
substituted for every occurrence of B 
likewise X + Y will be substituted for C. 

Interrupt Level: 

The Desk Calculator has one interrupt level which returns to 
tha input routine. When the Desk Calculator types 'BEADY', 
the next statement may be typed in. If the Desk Calculator 
is interrupted during execution of any command except 
•PRINT* or 'DUKP' there can te no guarantee that further 
execution will give correct results. "USER BEHABE". 

Errors 

Error messages are tabulated in CC-257. 



(END) 



CTSS FRCGBAMMER'3 GUIDE Section AH. 2. 19 12/69 1 

lieatif ication 

Interface between user and CTSS. 

• 

N. I. Morris 

Purpose 

The ". " cooiTBsand (read "dot" - or "point") serves as an 
interface between the user and CTSS, allowing the user to 
iacraasa his typing load by giving him wide latitude in the 
abbreviation of cominand and parameter names. It also allows 
tha chaining of caaiBands, and offers the ability to 
communicate between conscles- Other convenient features 

available through '*." are the ability to concatenate 
commands with the sane arguments, automatic resumption of 
SAVED files (the 8 command need not be given), automatic 
fil2 systam CALLS, optional suppression of printing of 
W(ait) and B (eady) lines, and the ability to initiate 
axacution of a SLEEPING program. 

Usat|e 

Since " .'• allows many user modified options, it must 
maintain a file containing these option settings in the 
user's own tracks. This file is named "USEB PROFIL" and is 
ona racord long. The first time "." is used, a standard 
copy of "USEB PBOFIL" will be copied from public file. 

1. Initiation: 

--> . 

Response is the character "fi" followed by two 
carriage returns, 

a. A normal command line may be typed, with 
spaces delimiting the parameters as usual. 
However, additional commands may be typed on 
a given line separated by commas, with a 
maximum of five commands comprising a single 
chain. These commands will be executed 
seguentially with "." attending to necessary 
linkages and restarting itself at the end of 
the chain. For example: 

FAE ALPHA (LIST) , LOAE ALPHA GAMMA , SAVE DELTA , START 

Note that the commas are parameters and 
therefore must be set off ty blanks. 

b. There is no restriction on the number of 
characters used in a given coitmand line. 
Mere than one console line may be employed by 



CTbS FBCGBAMMiiR'S GUIDE Section AH, 2. 19 12/69 2 



making the last parameter on a line be 
» (E'l-) ' fclloMed by the continuation on the 
next console line. The only restriction on 
coiiiniand line length (not to be confused with 
command chain length as measured in links) is 
that the total number of parameters 
(including commas, parentheses, and slashes) 
must be less than 50. 

c. To prevent the restarting of "." at the end 
cf a command chain, terminate the line with 
the parameter "slash" ("/"). Note that this 
tactic will allow the chaining of six 
commands. Commands which leave a desired 
cere-image (e.g. RBSTCR, LCAD, ate.) and are 
the last link of a coniroand chain should be 
fcllowed by the slash to prevent destruction 
of the core-image by the •'. ". 

d. Coniroands and parameters may be iterated by 
the use of parentheses. For example, the 
ccmnand line 

( BEPAP MCLOAD SAVE ) PBCG 

will generate 

EEFAP PROG 
NCLOAD PROS 
SAVE PROG 

and the command line 

fAP ( ALPHA BETA GAMMA ) (LIST) 

will generate 

FAP ALPHA (LIST) 
FAP BETA (LIST) 
JAP GAMMA (LIST) 

Abbreviations: 

a. Often-used commands and parameters may be 
abbreviated in ".". The abbreviation 

definitions are stored in the user's "US EH 
PHOFIL". rhey may be determined through the 
use of the internal commands 

ABEREV COM 
ABBREV PAR 

Mcte that "USER PROFIL" cannot be PRINTed 
successfully. The "ABBREV" command must be 
used t3 examine its contents. 



c.T9i^ FRCnRAMMER'S GCIEE Section AH. 2. 19 12/69 



b. To define abbreviations, the internal 

commands are "DC" (for comniands) and "DP" 
(for parameters)- General form is 

DZ abl ccinl ab2 coffl2 ... abn comn 
EP afcl pari ab2 par2 ... abn parn 

For example: DC LO LOGOUT 

c. To remove abbreviations, the internal 

coniniands are "RC" and "RP". General form is 
as follows: 

BC abl ab2 ... abn 
RP ab1 ab2 ... abn 

Example: RC LO 

d. Ihe abbreviation tables can each contain a 
maximum of 75 definitions. A parameter 
definition kill take precedence over a 
command abbreviation, where "coirniand" is 
understood to be the first item in a "command 
line". 

e. Two types of parameter abbreviations are 
permanently defined; they are automatically 
provided for and do not appear in the 
parameter abbreviation table: 

"Ox" is the abbreviation for "CHFLOx". 
".x" is the abbreviation for "(CFLx)". 

Private coniBands: 

"SAVEE" files may be resumed without explicit 
use of the "RESUME" command. ". " maintains a 
list of the primary names of "SAVED" files in 
"USER PROFIL". This list is consulted 

whenever a command is issued to determine if 
a "SAVED" version exists and a "RESUME" 
command should be generated. For example, if 
the user issues the command "ZILCH" and 
"ZILCH SA^ED" exists in his files, then ". " 
will automatically generate a "RESUME ZILCH" 
command. This private command list may be 
updated through the use of the internal 
command "DPDPRI" which searches the user's 
file directory for "SAVED" files. Mote that 
if "ZILCH SAVED" is created and "UPDPRI" not 
issued, "." will not "know" that "ZILCH" 
refers to a private "SAVED" file. 

The private command list checking feature may 
be turned off by issuing the internal command 



CTSS PROGHAMMER'3 3UIDE Section AH. 2. 19 12/69 4 



"SVLIsr OFF". In this mode, '♦." will perforin 
an FSIAIE for each command it generates in 
order to check for a private "SAVED" version. 
This made is considerably slower than the 
"SVLIsr ON" mode. When "." is'used for the 
first time, it will be in the "SVLISI OFF" 
mode. Issuing the "UPDPBI" command will 
update the user's "SAVED" files into "USER 
PBOFIL" and turn "SVLIST ON" automatically. 

Note that it is also possible to run with 
option bit 2 set, and let the supervisor 
check the existence of the SAVED file if 
necessary (see AH, 10.04, OPTION command). 

U, File system calls: 

In a similar manner to the treatment of 
RESOHEs ("private commands"), ".•» will also 
automatically furnish the "CALL" command (see 
AH.6.07) for file system subroutine calls. 
The following subroutines can be CALLed by 
typing the name of the entry followed by the 
necessary arguments: 

ALLOT FST&TE OPEN 

APTNAM lODIAG SEIPRI 

CHFILE MOVFIl TRFILE 
CELFIL 

For example, "STORGE 2" will generate the 
command "CALL STOBGE 2". 

5- Interccnsole communications: 

When a user is in "." either in waiting input 
or sleeping status, an interconsole message 
may be received. (Whenever the user enters a 
command line and "." is left, all 
communication is forbidden). This will 

prevent the user from receiving interconsole 
messages in his input buffer while editing, 
typsetting, etc.) 

Interconsole messages are sent using the 
revised ASCII character set. This permits 

the user to communicate using upper and lower 
case and all special characters. As in 

"lYPSET", " t" is the erase character, and "«" 
is the kill character. 

a. To send an interconsole message, use the 
internal command "WRITE" followed by the 
problem and programmer number of the user to 
whom the message is being sent. For example, 
"WBirt 1234 3187" would initiate the 



r-Ticc DDr\f7D A MM17» « Q r; IlT H P ^f»i~<-ir»n AH.1>^19 12/69 



transmission of a message to T23'4 3187. 
Subsequent input lines would be received by 
T23U 3187 if he desired to communicate. T234 
3187 could reply by typing bis answer, 

b. lo prohibit the reception of all interconsole 
coamunications, use the internal coniniand 
"FORBID*. 

c. Ic permit a particular user to communicate, 
use the internal command "ALLOW PROB PROS". 
If PH03 ie omitted, all users with problem 
number "PROB" will be allowed to communicate. 
If "PROB" is "♦", all users with programmer 
number "PROG" will be allowed. If both 
"fROB" and "PROG" are omitted, everybody will 
be allowed. 

d. The interconsole section of ". " may be left 
by giving a single "break" signal. This will 
cause the interconsole communications 
routines to exit to a fresh version of ". ". 

6 . Sleeping : 

Ihe internal com«and "RS" will initiate a 
sleeping program which will wake up every ten 
minutes and print a comment. Monopolization 
of lines to the computer in this fashion is 
rather anti-social, and should not be done 
unless absolutely necessary. Interconsole 

messages may be received and replied to while 
sleeping. After communications are 

completed, a single "break" will return the 
user to sleep. 

7. Response supression: 

Successive usages of the internal command 
"V." (verify) will alternately suppress and 
permit printing of the acknowledgement 
characters "H" and "W" and of the sleeping 
comment. 

8. Termination: 

The internal command • Q* will return the user 
to dead status. (Logging out may, of course, 
be acc3Mplished while in "."). "C" will 
prohibit further interconsole communication 
before going DEAD. It is wise never to quit 
out 3f ".", but to always use "Q", 
Otherwise, the user may receive interconsole 
messages unexpectedly. 



(END 



rTqq PHORRAHMER 'S 3UTDE section AH. 3.02 12/69 1 



lilentificaticn 

Context editor foe cacd image files 
ED 

I B t r o due tic n 

ED is a command for editing m-word BCD card image files 
within CTSS. The command is based on TYPSET (CC-2UU, 
MAC-M-193 by J. H, Saltzec) and many of the conventions of 
TYPSET are used by fC. Tabs ace automatically interpreted 
for FAP, MAD, HADTRN, SPSS, COHIT, and ALGCL(i.e. , AED) 
programs. Tabs may also be set by the user for other 
purposes. Although line numbers may be generated by the ED 
:;ommand, editing is done entirely by context. 



ysa^e 

The ED command is initiated with the following CTSS command. 

ED -SAWEI- NABE2 -NAWE3- 

NAME2 is the seccndary name of the file to be edited or 

created and must be provided. SAME1 is the primary name of 

the fil3 to be edited. If NAM El « AM E2 is not specified, ED 
will assume that a new file is to be created and will start 

in the high-speed INPUT mode. If NAWEI is provided, the 

command will lock for the file HAMEl NAME2. If the file is 

not found, the high-speed INPUT mode will be entered. If 
the file is found, the ECIT mode will te entered. 

If NABB3 is specified and the file NAMEl NAnE2 is found, the 

subsequent FILE will create a file NAME3 KAME2 and NAMEl 

MAME2 will remain unaltered. Any arguments to the FILE 
request, however:, will take precedence. 

New files will be created only on the disk (device 2) and 
old copies resideat on the drum will disappear if modified. 
The original file to be edited may te a linked file, 
however, any attempt to replace a linked file by the edited 
varsion will be rebuffed. The modified version Bust be 
filed under a different name. Linked files of the name 
•(INPUT prog' and • (INPT 1 prog* where 'prog* is the user's 
programmer number may not exist in the file directory or EC 
will not function- 



CTiiS PROGaAMMEB»S SLIDE Section AH. 3.02 12/69 2 



HIGH-SPEED INPUT MODE: 

Whan ths user entets this mode, the ED connnand will type 
"lUPUT:" or. the user's ccnscle. Whila the user is operating 
in this mode, the £D command will accept input lines from 
the user's ccnscle. Tabs will be interpreted automatically 
for each input line. Backspace characters may also be used 
to move back one character position in the input line. No 

rasponse is typed for input lines and as a result, the user 
may type successive lines as fast as he wishes. When the 

user types a line consisting only of a single carriage 
raturn, the ED command will place the user's console in the 
EDIT mode. 



EDIT M3DE: 

Whan tba user enters this mode the response "EDIT:" will be 
typed on the user's conscle. At this time the user aay type 
raquests to the ED cooiffland. All changes made to a file 
become effective immediately and as a result, the user is 
abla to make recursive modifications to his file. We may 

think of a pointer which is positioned at a line in the 
aiited file. Wheo the user enters the EDIT mode from the 
INPUT mode, this pointer will be positioned at the last 
input line typed by the user. When the user starts the ED 
command in the EDIT mode, the pointer is positioned before 
the first line in the old file. If the end of file is 
reached by an EDIT request, the comment "END OF FILE BEACHED 
B5f:" is typed on the user's console followed by the request 
which caused the end of file to be reached. At this time 
the pointer will be positioned after the last line in the 
fila. Whan in the EDIT mode, any line which is not a 
legitimate EDIT request will cause the comment "NOT A 
REQUEST:" to be typed on the user's console followed by the 
lina which caused the error. In many cases it is possible 
for the user to stack EDIT requests. If one of the requests 
causes an error massage to be typed, any stacked requests 
will be ignored. This is done in case one of the stacked 
requests depended on the successful completion of the 
request in error. 

Any number of initial tabs or spaces (including 0) may occur 
in 1 raquast line. Arguments and the request must be 

separated by at least one space or any number of tabs or 
spaces. Wherever the argument is line image, however, tabs 
ani spaces retain their normal significance. 



Error massag.es 

Some errors from the file system will result in a PfiNTER 
typa arror message followed ty a question to the user of 



rr^si PHoaHAMMER»s GLIDE section AH. 3. 02 12/69 3 



whether or net he wishes to continue. An answer of 'NO* 
will result in a call to DOBMNT so that the user aay SAVE 
the command, fix the problem, and RESUME the command. 



EDIT REJ2]iI^I^: 

REQUEST: FIND line 

ABBREVIATIOS: F 

RESPONSE: none 

ERRORS: END OF FILE 

The FIND request is used to aove the pointer forward from 
its present position to the line specified by "line". 
"Line" is a noraial input line and aiay contain tabs and 
bickspaces. This line is used as a mask for selecting the 
lasirad line in the edited file. Matching is done only on 
the non- blank characters specified in LI BE. For example, 

tha request, 

F (tab) -(tab) -ALPHA, 1 

might be used to find the line, 

LOOP TIX ALPHA ,1,4 

REQUEST: LOCATE string 

ABBBEVIATICW: L 

RESPONSE: none 

ERRORS : END OF FILE 

Tha LOCATE request is used to move the pointer forward from 
its present position to the first line which contains the 
sntira character string specified by "string". The full 
line of 84 characters is scanned, so that "string" may 
specify line numbers. It is recommended that "string" 
include the leading zeros of the line nuinters to avoid any 
undesired match with program constants. 



REQUEST: 


NEXT I 


ABBREVIATION: 


N 


RESPONSE: 


none 


BRBCRS: 


END OF 



FILE 

This request is used to move the pointer forward from its 
present position in the file. "I" specifies the number of 
Unas to be skipped over. If I is "0" or not specified, it 
is assumed tc be "1" and the pointer will be moved to the 
n^xt line in the file. If the NEXT request is given after 
the end of file has been reached, the pointer will be reset 
to th3 beginning of the file and moved "I" lines froni there. 



CTSS PROGRAMMEB'S 3 UIDE Section AH. 3.02 12/69 H 



HEQUEST: DELETE I 

ABBBEVIATICN: D 

RESPONSE: none 

CRROBS: END OF FILE 

Tha DELETE request will delete "I" lines froni the file 
starting with the line at which the pointer is currently 
positioned. If I is "0" or left unspecified, only the 
current line will be deleted. The E2illter is left at the 
£Osi tion vacated b^ the last lini delated bj. this reg.uest. 

REQUEST: PRINT I - L- 

ABBREVIATION: P 

RESPONSE: printed lines 

ERRORS: END OF FILE 

The PRINT request will print "I" lines from the file 
starting with the line at which the pointer is currently 
positioned. Upon coinpletion of this request, the pointer 
will be left pointing to the last line printed. If I is "0" 
or left unspecified, one line will be printed. Normally 

linas are printed without line numbers. If the character 
"L" is present in the PRINT request, line numbers will be 
printed to the tight of the printed lines. 

LINE 



REQUEST: 


RETYP 


ABBREVIATION: 


R 


RESPONSE: 


none 


ERRORS: 


none 



This request will cause the line at which the pointer is 
currently positiooed to be replaced by LINE. LINF is a 
normal input line and may contain tats and backspaces. The 

REQUEST: TOP 

ABBREVIATION: T 

This request will cause the pointer to be reset and 

positioned before the first line in the file. In addition, 

an automatic TOP is performed by the FIND, LCCATE and NEXT 

it tha pointer was positioned at the end of the file. 



REQUEST: 


BOriOM 


ABBREVIATION: 


B 


RESPONSE: 


INPUT : 


ERRORS: 


none 



This request will cause the pointer to be positioned after 
tha last line in the file. Upon completion of this request 



HEQUEST: 


INSERT 


ABBBEVIATICN: 


I 


RESPONSE: 


INPOr : 


ERRORS: 


Qone 



CTSS PROGRAMMER'S SIJIDE Saction AH. 3. 02 12/69 5 



the user's console will be placed in the high-speed INPUT 
moda. All subsequent lines will be treated as input and 
added to the end ot the file. 



or (C.R.) 



This request will cause the user's console to be placed in 
the high-speed INPUT made. All subsequent lines will be 
treated as input and inserted after the line at which the 
pointer is currently positioned. If the INSERT request is 
givan immediatly following a TOP request, the inserted lines 
will be placed at the beginning of the file. 

BEQUEST: INSERT line 

ABBBEVIATICN: I 

Response none 

Errors: none 

Tha INSERT recjuest may be used to insert a single line 
without changing to the high-speed input node. Line iS a 
normal input line. It is inserted following the line at the 
present pointer position, 

REQUEST: CHANGE Qstr ing iQstr ing2Q I G 

ABBREVIATION: Z 

RESPONSE: none 

ERRORS: END OF FILE 

This request will examine "I" lines starting at the line at 
which the pointer is currently positioned. Upon completion, 
the pointer will be left positioned at the last line 
axamined by this request. If I is "O" or left unspecified, 
it is assumed to be "I" and only the current line will be 
examined. The character "Q" is taken to be the delineator 
or "Quote character" and may be any character in the 6-bit 
BCD set. "stringl" and •«string2'' are arbitrary BCD 

-haractar strings and may be of different lengths. If the 
character "G" (GLOBAL) is present, ever^ occurrence of 
string! will be replaced by string2. If "G« is not present, 
only the first occurence of stringi will be replaced by 
strin32 in each exanined line. EXAMPLES: 

line: ALPHA= ALPHA+ALPHA 

request: C ♦ALPHA*BEIA* 
new line: BETA= ALPHA+ALPHA 

request: C ♦ALPHA*DELIA* 1 G 
new line: BEIA= EELTA+DELTA 



CTSS PKOGRAMWER 'S 3 DIDE Section AH. 3. 02 12/69 



raguest: 


C 


♦DELTA* ♦* 


new line: 




E£TA= CELT A 


REQUEST: 




BLANK line 


ABBREVIATION 




EL 


RESPONSE: 




none 


ERRORS: 




none 



The BLANK request will put blanks in the current line 
whatevar non-blank characters appear in ••line". For example 
»BL ♦♦♦*♦»» will clear the label fieli of a line in a FAP 
f il3- 



line 



REQUEST: 

ABBREVIATION: 

RESPONSE: 


OVRLAY 



none 


ERRORS: 


none 



Tha OVBLAY request will place the non-blank characters of 
"line" into the corresponding position of the current line. 
Notic3 that only non-blank characters of "line" replace what 
was in the current line. For example in a FAP file, if the 
current line is 

than 

will produce 



T XI ♦♦ 1 

EOF (tab) bbH (tab) (tab) comment 

EOF TXH ++1 comment 



REQUEST: VERIFY 

ABBREVIATION: VE 

RESPONSE: none 

ERRORS: none 

The VERIFY request sets the verify mode. In the verify 

moda, completion of any of the requests FIND, NEXT, LOCATE, 
OVRLAY, BLANK and CHANGE will cause the printing of the 
current-pointer line. In addition, CHANGE will cause the 
printing of all changed lines. Requests may not be stacked 
while in the verify mode. 



REQUEST: 


BRIEF 


ABBREVIATION: 


BR 


RESPONSE: 


none 


FHRORS: 


none 



CTSS EPCGfiAHMER'3 GUIDE Section AH. 3.02 12/69 7 



The BRIEF request sets the brief or noraal mode. Within the 
brief mode, the FIND, NEXT, LOCATE, OVRLAY, BLANK, CHAMSE 
raquests will not give the responses expected in the verify 
mode. 



REQUEST: 


CLIP 'ON* or 'OF 


ABBREVIATION: 


CL 


RESPONSE: 


none 


ERRORS: 


ILLEGAL ARGUMENT 



The request CLIP ON sets a mode such that any input line 
whi:;h exceeds column 72 will cause the message "TRUNCATED:" 
followed by the faulty line image. Any waiting input lines 
will have been deleted. Requests on which this may occur 
are FIND, INSERT, RETYPE, OVRLAY, BLANK and high-speed 
INPUT. The request CLIP OFF resets the mode . The normal 
moie is CLIP ON for all files except FAP files which are 
normally CLIP OFF. 



REQUEST: 


SERIAL 


ABBREVIATICN: 


S 


RESPONSE: 


no ne 


iiRRORS : 


none 



This raqusst is used to change the increnent between line 
numbers of successive lines to the increment specified by 
tha decimal integer "N". Initially, this increment is set 
to 10 by the ED command. If N is "0" or not specified, it 
is assumed to be "10". Lines inserted after a line with the 
line number " L" will be sequenced L + N, L+2N, L + 3N, etc. If 
tha lines following the inserted lines have line numbers 
which are less than or equal to the line number of the last 
inserted line, as many lines as necessary will be 
rasaguanced to insure that all line numbers are unique and 
in ascending order. For example, assume that "N" is 2 and 
tha user wishes to insert 9 lines after line 25 in a file 
that was previously sequenced by fives. The inserted lines 
would be numbered, 27, 29, 31 ... U3. The lines previously 
numbered, 30, 35, 40, 15 and 50 would be renumbered to, 45, 
47, 49, 51 and 53 respectively. The remaining lines in the 
fila would be unchanged. 



REQUEST: 


COLON a 


ABBREVIATION: 


CO 


RESPONSE: 


none 


ERRORS: 


ILLEGAL ARGUMENT 



CTSS PROGRAMMER'S SUIDE Section AH. 3.02 12/69 8 

A colon (or bactcspace on 1050) is a logical backspace 
anywhere, eg., 'ABC ::: Db(C.R.) is interpreted as 'DbC. 
Tha colon moves the character pointer tack one but does not 
erase the characters over which it has ffloved. One should be 
::araful in using this convention that the total nuBber of 
characters dees not exceed 84, as any extras will be added 
to the next line during INPUI, or result in a request during 
EDIT. 

The COLCK request allows the colon character to be inserted 
is text. (They may also be 'CHANGE'd in as desired.) If 'a* 
is T or TEXT, all »:• will be treated as text except for the 
•:» as the first character after a tab. If 'a' is B or 
BACKUP tha noriaal mode will te reinstated and all •:• will 
be backspaces. 

REQUEST: TABSET T1 T2 ... TN 

ABBREVIATION: lA 

RESPONSE: none 

ERRCBS: ILLEGAL TAB SETTING 

Ti specify the columns at which tabs are to be set. Tabs 

must be set in ascending order and may not exceed column 72. 



REQUEST: FILE -NAMEU- 

ABBBEVIATICU: FL 

RESPONSE: ♦ 

EfiHORS: NO FILE NAME GIVEN 

cr FILE WORD COUNT ZERO 

NOTHING IM FILE 

INPUT : 

This request is used to terminate the editing process and 
write the new edited file on the disk. lliAKE4 specifies that 
tha new file will be created as NAME4 NAME2. If NAME4 NAME2 
is not specified, the old file will be replaced by the 
alited file or a new file NAME3 NAnE2 will be created. If 

no name was given by the initial ED command or by the FILE 
request, an errcr message will be printed and the FILE 
raguest will be ignored. 

IE a file to be deleted is either READ-ONLY or PROTECTED, 
confirmation of deletion will be requested. If confirmation 
is isniad or if file is LINKed, the EDIT mode will be 
reentered with the pointer at the top of tha file. Any 

moias associated with the previous copy of the file will be 
transferred to the new copy. 



(END) 



CTSS PROGBAMMEH'S 5UIDE Section AH. 3. 03 12/69 1 



Save present doraant program. 
SAVE, MYSAVE 

Purpose 

The user may preserve a currently-dormant program (e.g., 
just loaded, interrupted by the guit button, file system 
errors for which no error return was specified, or called 
DORMNT) and its machine conditions via the commands SAVE or 
MYSAVE. Execution may be either begun or continued at some 
liter time by use of BESGHE or CONTIH; the core image, et 
al. , may be reinstated at some later time by use of BECALL 
or BEST08 (see AH. 7. 03). 

Usaig. 

SAVE -8AME1- - 'T*- 
HYSAVE -SAHE1- -'T'- 

SAVE In addition to the core image and machine 
conditions, SAVE will save the status of any 
active files so that they may be repositioned 
by RESUME and RESTOR. It will also save any 
command chain present. 

MYSAVE In addition to the core image and machine 
conditions, MYSAVE will save the status of any 
active files in the current file directory, 
but will then switch to the user's file 
directory before creating the SAVEE file. 
This is the version used by automatic logout. 
Resumption of the SAVED file from the user's 
file directory by RECAIL or CONTIH will 
perform the necessary switch of directories. 

BAME1 The created file is given the name MAHEl 
SA VED . 

T The SAVED file will be created in temporary 
mode. 

IE no arguments are furnished, the file created representing 
the current state of the user's program will be given the 
first name 'PROGN', the user's programmer number, and the 
ganaric second name 'SAVED*. 

It a file already exists which has the same name as will 
result from a SAVE or MYSAVE, the old version will be 
truncated; the old version's mode is, then, preserved. 



CTSS PROGRAMMER'S GUIDE Section AH. 3. 03 12/69 2 

£E£o£ Conditions 

FILE NAME1 SAVED IS LOCKED, SAVE NOT EXECUTED. 

Anothar user was refecencing file NAME1 SAVED; the SAVE or 
MYSAVE must be repeated. 

ERROR n FOUND AT loc IN CALL TO entrj FOR 8AME1 SAVED 
SAVE NOT EXECUTED. 

A fils system error involving the file NAME1 SAVED has 
ocaurrad. The SAVE must be repeated, probably with a new 
NAMEl. 

Restriction 

If tha user's memory bound is zero (i.e. no core image 
left) , the SAVED file will contain only command buffers and 
diractory switchiay information. Such a file cannot be 
restarted by RESUME or COHTIN, It can, however, be restored 
by BECAII, in order to load command buffers and restore 
directory attachment. 



(END) 



CTSS PBCGHAMMEB'S GOIDB Section AH. 3, 04 Page 1 



IlSIiJ^if ication 

Saving and renaroing tempcrary file generated by RUNCOH 
SAVFIL, REBUN 

Pur£Osa 

In order to preserve the user's core image and machine 
coniitions as needed during a chain of coBiaands, RONCOM 
generates a series of temporary mode SAVED files with 
primary names of the special form .,.COn when n=1,2,3, etc. 
The problem arises of preserving these files when a a ROHCOM 
is SAVED in midstream, and desired to be CCHTINued at a 
latar time - either in a subsequent LOGIM session, or after 
another HUSCOM. SAVFIL and RERUN are designed to preserve 
these files, 

Usa^e 

SAVFIL NAMEI 

RERUN HAM El 

SAVFIL works on the unbroken chain of SAVED files 
with primary names of the form ...OOi, 
i=n,n-1 , ... ,2 ,1 where ...00(n<-l) SAVED does 
not exist. Working in decreasing value of n, 
it renames the file ...OOn SAVED to an unused 
name of the form $$$00j and makes it permanent 
mode. Finally, it appends the list of new 
names $$$00j to the file MAMEl SAVED. 

REFUN restores these files to their original names 
and mode form the information continued in the 
file NAME1 SAVID. NAMEl SAVED is unchanged. 

The recommended (and probably ONLY) way to use these 
commands is as fellows: 

My SAVE NAME! to sav€ a RUCOH jcb- 

SAVFIL NAMEl 



RERUN NAMEl to continue the SUNCOM at 

COST IN NAMB1 any future time 

As automatic logout performs the MISAVE but not the SAVFIL, 
a good practice would be to issue a SAVFIL progL (where 
•prog* is the user's programmer number, used as the saved 
file name) immediately at one's next LOGIN, if it is desired 
to CONTINue the job at a later time. 



CTSS PSCGRAMMER'3 3UICE Saction AH.3.0U Page 2 

Both SAVFIL and RERUN operate only in the user's file 
directory. 



/END^ 



CTSS PROGKAMMER'S GUIDE Section AH. 3. 05 12/69 1 



Identif icaticn 

Link to files in other U. F. D'S 
LINK, UHLINK, PERMIT, RETJOKE 

Par£osa 

A user may allow files in his directory tc be accessed by 
other users by means of a mechanism known as "linking". The 
usars who have been allowed to form "links" or "link 
pointers" (U.F.D. entries which point to other 0. F. D. 
antrias instead of to the file itself) to a file need not, 
then, have a copy of the file in their own directories. It 
is also possible to establish links which have names other 
than those cf the actual file. Hhan he grants permission to 
link, the "owner" of a file specifies who will be permitted 
access and what apparent mode the accesscrs will have tc 
treat the file in. 

ysaia 

If any of these commands is typed without arguments, the 
response will indicate the proper format. 

1) Grant permission: 

PERMIT NAME1 IIAME2 MODE PROS PR3G 

NAHEl NAHE2 is the name of the file in the current 
file directory to which the author is granting 
linking permission. The file SAMEl NAKE2 need 
not exist, may exist in any mode, or may be a 
link pointer in the current file directory to 
a file or link pointer in some other 
directory. Linking permission, therefore, may 
be granted to any file to which the current 
file directory has access or may have access 
in the future. PERMIT does not actually 
establish a link. If HAME'i is ♦, all primary 
names are implied. If NAaE2 is *, all 
secondary names are implied. 

MODE is the mode which the author wishes to permit 
for the file. During the linking process, 
this mode will be 'or'ed with any other modes 
in the chain of links to determine the final 
mode. The mode may be octal or alphabetic 
with the following correspondence: 



CTSS EPCGBAKMER'5 GUIDE Section AH, 3. 05 12/69 2 






1 


2 


4 


10 


20 


100 





I 


S 


R 


H 


V 


p 



4> 



PROB PROG specifies the problam number and progcaianier 
numbec of the user to whoa the file NAME1 
NAME2 is being permitted. If PROB is * all 
problem numbers are implied. If PROG is 
all programmer numbers are implied. 

2) Withdraw permission: 

REVOKE NAME1 NAME2 PRCB PflCG 

REVOKE withdraws the linking permission for file 
NAMEl NAttE2 of the current file directory from 
the user PROB PROG. Note that REVOKE does not 
reaDve any links that have already been made. 

3) Form a link : 

LIHK NAHEI NAHE2 PROB PROG -NAHE3- -HAME4- 

IINK establishes a link in the current file 
directory to the file NAMEl NAME2 in the file 
directory of PROB PROG. 

When SAME3 HhKEH is specified, NAHE1 NAttE2 is 
the name given to the file in the current 
directory and NABE3 NAHE4 is the naaie of the 
file in the directory PROB PROG. If NAME4 is 
not specified, HAHE2 will be used as the class 
name. 

If permission has not teen granted, the link 
cannot be established. Links may be 
established through a depth of file 
directories which is currently set by the file 
system to two, 

4) Remove a link : 

UNLINK NAHEI NAME2 ... NAMEIn ISAME2n 

UNLINK will rejove links to files so specified. If 

♦♦• is used as a primary name ail files with 
given secondary name will be unlinked. If »» ' 
is used as secondary name, all files with 
specified primary name will be unlinked. If 

UNLINK * ♦ is typed, all links are removed. 
If either name contains imbedded ♦•s, the 
"LISIF ♦ convention" will te applied. That 

is, the * will match any character including 



CTSS FPCGRAMMES'S GUIDE Sec^'ion AH. 3.05 12/69 3 

blank. 

This conmsand in no way affects permission. 

NAMfil HAHE2 must be the name by which the file is 
kncwn in the current file directory. 



H2thoa 



The EEBMIT coffimand establishes a file named PBRMIT FILE (VP 
moia) in the directory of the user giving permission. This 
fil3 is line-marked, and may be printed out with the PRIST 
command. In the case of problem numbers which have common 
fil3 directories, a PEBMIT BILE in a common file should 
probably be uaintained by a designated member of the group. 



(END) 



CTSS EPCGRAMMER'S GOICE Section AH.l.Oft S/fth 



13 e n tif lea tion 

Ta pa-handling comaiands 

MOUNT, UflCONT, V EBIFY, LABEL, TAPPIL 

Piir£Ose 

Thase commands have been added to CTSS to facilitate reading 
and writing cf tape files using the standard file system 
::alls. To use a tape, the Tape Strategy module must be told 
to mount it, its standard file header must be read and 
checked, or written, and the file system must be told that 
it is a tape file. (See also Section AG. 5. 05 for additional 
information about tape usage in foreground.) 

Restriction 

To use foreground tapes, a user must have a 

administratively-assigned tape record quota. Because the 

US3 of tapes makes unusual demands on both the system and 

the operators, assignment of such quotas will be the 
axcaption rather than the rule. 

Usaqe 

1> Mount a tape: 

WCUHT NAME LOGUNT -BIHG- -CHAN- -MESS- 

VAME is the name or reel number of the reel to be 
mounted. 

LOGUMT is a logical unit number by which the user 
wishes to refer to this tape. Any number 

(L. E. 2. P. 18} will do, providing it is one 
that the user has not already used. 

RING may be either •RI!JG» or •NOBING*. It 

specifies whether or not the reel should be 

file- protected, •MOBING* will be assumed, if 
not specified (i.e., file-protected). 

CHAN may be •!» or '2* in the current system for 
channels A or B, respectively. If not 

specified, the supervisor will pick a channel. 

MESS if present, must be either the characters 
•HISS' or '(HESS)*. If the former, the 

supervisor will then type 'TYPE', Up to 12 
words of message to the operating staff will 
be accepted. If the latter, it must be 

followed by SAME1 NAnE2, which refer tc a card 
image (line-numbere d) file containing the 
desired message. 



CT5S PROGHAHHEa'S 3UTDE Section AH. 3.06 5/66 2 

The optional parameters may appear in any order. 

The message sent to the operators is of the form: 

FDB TAPE REFEBRED TO IN FOLLOWING MESSAGE, ASSIGNMENT IS A8 
USER PBOBNO= M1416 OSBR PBOGNO= 3 

MOUNT TAEE 199 WITH SORING ... user comment ... 

2) Discount a tape: 

UMDUNl L03UNI -MESS- -fllNG- 
where LOGONT, MESS, RING are as above. 

3) Verify the label on a pre viously- written tape: 
(This must be done before opening the file.) 

VERIFY LOGUNT -FILE- 

LOGUNT is a logical unit previously referred to by a 
•MOUNT' command. 

The program will say 'TYPE LABEL*. The 24 

characters typed next must correspond to the 
label on the tape. If the tape cannot be 
mounted or the label does not match, a message 
will be printed. 

FILE refers to NAME1 NAME2 of a card image 

(line- numbered) file, from which the first 24 

characters will be taken as the label. This 

option overrides the console typing just 

descr ibed . 

4) Write a label an a tape: 

LABEL LOGUNT -FILE- 

LOGUNT is a logical unit number referred to by a 
previous •MOUNT* request. 

The prcgraa will ask for a 24-character label, 
which will be written on the tape to provide 
the label which will be VERIFYed if the tape 
is to be read again. If the tape is bad or 

cannot be mounted, a comment will be printed. 

FILE is the same as under the VERIFY description, 

5) Declare a file to be on tape: 

TAPFIL NAME1 NAME2 LOGUNT -PILENO- 



CTSS PROGRAMMER'S GUIDE Section AH, 3. 06 5/66 3 

NAME1, HAME2 is the name of tha file. 

LOGUNT is a Iccjical unit number, as in 'MOUNT', etc. 

FILENO if specified, is the number of the file on the 
reel specified by LOGUNT. A FILENO of zero 
specifies the end of a set of files on a reel, 
so that this may he used to add to the end of 
a reel. FILENO is assumed zero if not 

specified . 



(END) 



PTqq PRORBa MMPR • q nnrnp <?3r! fi nn ah. 1.07 '\/f,h 



I dept i f icat ion 

Context editor fee 6-bit mode 

EDL 

J. H. Saltzer 

Purpose 

EDL is a context editor for line-marked, 6-bit BCD files. 
SQUASH SAVED is available in the public files to change 
currently- existing card-image (line-numbered) files to the 
lina-marked format, which is currently acceptable to EDL, 
MAD, and FAP. (Files created by EDL itself are, of course, 
lina-marked. ) A significant saving of both space and tiae 
will be effected by the use of EDL instead of ED. 

Usa^e 

EDL NAME! NAI1E2 

NAME1 NAME2 is the name of the file to be edited. 

Editing conventions are identical to those of 
the TYPSEI command (Section AH. 9-01), except 
that only the 6-bit character set may be 
used. In addition to the TYPSET erase (#) 
and kill (4) characters, EDL also accepts the 
standard CTSS erase {••) and kill (?) 
characters. A backspace character will be 
set in the file as a colon. Tab characters 
will be inserted in the file wherever typed. 

Erro£ Condition 

•INPUT FILE HAS IMPROPER FORMAT.' will be printed if EDL is 
being used en a file which is not correctly line-marked. In 
particular, this condition will occur if the file is of 
card-image format. lo prevent damage to the file, quit out 
of ths command (d3 not use the 'file* request) and either 
SQUASH the file or use EC. 



(END) 



CTSS ERCGRAMMER'3 GUIDE Section AH. 3-08 12/69 1 



Ii§.Q.li.fi.2S.tion 

Binary file editing program 

EDB 

J. H. Saltzec 

Purpose 

EDB is a reincarna ticn of the TYPSET and EDL editing 
commands for use with arbitrary binary files. 

Usag_e 

EDB namel naae2 

will allow creatian or editing of the file "namel name2". 
Th3 editing conventions of ECB are identical to those of EDL 
and TYPSET, as described in section AH. 9. 01. Each 36 bit 
word of the file being edited is a distinct line in the 
sense of the TYPSBT description, and is represented for 
aditing purposes as a 12-digit octal number. Care should be 
taken to insure that after input or editing, there are 
axactly 12 octal digits in a line. If there are more than 
12 octal digits, the last 12 will be used: if fewer, leading 
z^ros will be appended. Non-octal characters will be 

converted to octal by truncation of the high order bits. 



(END) 



PTqq PR r«R» MMRR'=: stirnE Section AH. 3.09 6/69 1 



I^entif icaticr 

QED taxt editor 
Ken Thompson 

Puc£Ose 

QED is a ccfflinand foe editing symtolic text. Its input and 
output are either console, 6-bit, 12-bit, or ASCII files, or 
i combination of these. QEC keeps all text internally in 
the ASCII character set. extensive facilities for 

insarting, deleting and changing lines of text, a search 
feature, a macro feature and a large number of possible text 
buffers. 

Dis::ussion 

QED, like most editors, performs operations on text in a 
workspace. In QHD the workspace is called a 'buffer*. A 
buffer consists of from zero to (ideally) any nuaber of 
lines of noriral text. Each line must be terminated in an 
end-of-line (carriage return) character. Not counting the 
and-of-line character, a line consists of from zero to 
(ideally) any nuirber of characters. 

QED, unlike most editors, has another level of hierarchy. 
Th2 text in QED's workspace is broken up into from one to 
(ideally) any number of buffers. Each buffer is identified 
by a name of from one to five characters. There is one 
current buffer and all of the other buffers are auxiliary 
buffers. The auxiliary buffers allow temporary workspace to 
store text. Any cf the auxiliary buffers can become the 
riurrant buffer; at which time the old current buffer becomes 
an auxiliary buffer. 

QED accepts comioands and text from a stream of characters. 
This stream normally comes from the console. Special 
characters in the stream can divert the stream to a text 
buffer. In this way, predefined commands can be placed in a 
buffer and then executed by diverting the command stream to 
this buffer. This buffer in turn may divert the stream to 
another buffer or (recursively) to the same buffer. At any 
time, the stream can be diverted to the console for one line 
of text, 

QED has a very unifDrm command format. Each coamand acts on 
text in the current buffer and possibly on an entire 
auxiliary buffer. The text in the current buffer is 
spacifiad by a series of from zero to (ideally) any number 
of line addresses. Two adjacent lina addresses are separated 
by aither a comma ar a semicolon. Only the last two 

addresses are •remembered* although ona address may affect 
tha avaluation of subsejuent addresses. The couroand is 

represented by a single character. This character is usually 



CTSS EBCGBABM£R«S GUIDE Section AH. 3.09 6/69 2 

mnemonic of the action of the command. Depending upon the 
command, qualifying data may be needed after the conmand 

^haractar . 

A::tual details on CDmmands and addresses follow. 

REGULAR HP8ESSI0NS 

Regular expressions can best be described by example. In the 
following examples, the characters */*, '|», »♦», »(» and 
•) • are operators in the expressions. 

/a/ will match the letter » a* anywhere on a line, 
/abed/ will match the word 'abed* anywhere on a line. 
/ab*c/ will match the words 'ac* , 'abc', »abbc', 'abbbc' ... 
/ibcldaf/ will match the words ♦abc* or • def 
/{i|o)nto/ will match the words 'into* or 'onto* 

The operators •{» and •}• have the same meaning as the 
operators •(' and *)*• When braces rather than parentheses 
are used to bracket sub-regolar expressions, the regular 
axprassion in braces is named by the character immediately 
following the right brace. (See SUBSIIIUTE and VERIFY 

commands.) 

In addition, the characters •"*, *.* and •$ * are special. 
Thay are not operators, bat just special characters. The 
character •"• will match the 0th character on a line. The 
character •$' will match the character after the last 
character on a line. The character ♦.• will match any 
::haractar on a line. 

/.♦/ will match an entire line regardless of length, 

/""beginl end$/ will match a line beginning with 'begin* or 

ending with *end*. 

/in.*to/ will match a line containing • in» and » to* in that 

order. 

/"bag. ♦end*/ will match a line starting with 'beg' and 

ending with ' end* . 

/" $/ will natch a blank line. 

/$V will also match a blank line. 

/$."/ will match nothing. 

A null regular expression is identical to the last regular 
expression. (Upon initial entry, after a syntax error in a 
regular expression, and after a Read, Write, or List 
command, a null regular expression is an error.) ~ 

BUFFER HAMES 

Buffers are named with a one to five ciharacter name. The 

nima is enclosed in parentheses. if the name is one 

character Icrg (not 'cr* or • ( •) the parentheses may be 

oinittad. The buffer name can be any length, but only the 



CQi-<-i f\n AH ■* no f^/f^Q 



last 5 characters are significant. The buffer naiaes »X* and 
• (X) • are identical. 

lEXr AIDRESSING 

Linas in the current buffer may be addressed in the 
follow in" wa^s: 

1) By relative line naabers. 

A decimal nunber is interpreted as a relative line 
number. The first line is numbered 1, the second 2, 
ate. The relative number of a line is its current 
position in the text buffer. This number may change 
during editing. 

2) By absolute line numbers. 

The character • imnediatly followed by a decimal number 
is interpreted as an absolute line number. After a 
successful read coomand, every line in the current 
buffer is assigned an absolute line number that is the 
same as the relative line number at that time. The 
absolute line number does not change during editing 
axcept after a read. Ne* lines created during editing 
have undefined absolute line numbers. 

3) By '. ». 

The value of •.' is the current line. This value is 
changed by most editor commands. 

U) By •$». 

The value of •$» is the last line in the text buffer. 
This number may change during editing. 

5) By context. 

The structure '/regular expression/* causes a search 
for a text pattern that matches the regular expression. 
The search begins at the line after the current line 
and cycles to the current line. If the search is 
successful, the value of Vtegular expression"/ is the 
first line found containing the text pattern. 

6) By additive combinations of 1-5. 

An address followed by •*• or * -* followed by another 
address is alsa an address. The value is obvious. 
Evaluation is done left to right. At no time during 
evaluation may an address exceed the bounds of the 
number of lines in the text buffer. In all unambiguous 
cases, the • + • may be omitted. C.+ii* is the same as 
•.<*«, but '5+2* is not the same as '52'.) 

In subsequent discussion, 'A' will indicate any legal 
address. 



\K 



CTSS EPCGRAMMEB»5 GUIDE Section AH. 3. 09 6/69 



EDirOR INPUT 

Th3 input to gED is a stream of characters. Depending upon 
the context cf the stream, some of the Dharacters are 
interpreted as commands to the editor, and soDee of the 
characters are interpreted as literal text. In either case, 
the following characters are recognized by the editor as 
iiractives to the character stream and not as any editing 
function: 

\Bx 

These character are removed from the character stream 
and are replaced by all of the characters (in seguence) 
in buffer x (where x is the name of a text buffer.) 
Hscursion is allowed to a depth of 500. The special 
case where the characters *\Bx* are the last two 
characters in a text buffer is treated specially and 
doas not cause an increment of the recursion coant. 

This character is removed from the character stream and 
is replaced by the next complete line from the console. 
Any partial line remaining from the console is skipped. 
In the line that replaces the \R character, the 
characters »\H« and 'XB* cause no special action. 

During console input, corrections may be made with the 
following control characters: 

\E 

Delete the preceding character. (The default alternate 
to \E is •#». See 'e' option in the CFTION command.) 

\W 

Delete the preceding characters up to, but not 
including, the first blank followed by a non-blank 
character. In other words, delete the preceding word. 

Delete the entire line. (The default alternate to \K 
is •*». See the 'k' option in the CITICH command.) 

TEXT INPUT 

There are three QED commands that expect to be followed by 
literal text input. This text must te preceeded by a space 
or a carriage return. The text itself consists of an 
arbitrary string of characters that terminates in the 
seguence ' (cr)\F'. The 'NF' character is not part of the 
literal text, but only serves to show the end of the text. 

In subseguent discussion, •-text-' will indicate literal 
t;? xt input. 



\K 



CTSS PROGRAMMKR » s SDIDE Saction AH. 3. 09 6/69 5 

EDITOR COMHANDS 

1 ) APPEND contsand. 

a) A A- text- 

The editor accepts text which is inserted after 
the line addressed. The value of '.' is set to 
the last line inputted. 

b) A-text- 

is identical tc 'SA-text-'. 

2) BUFFEB command- 
a) Bx 

The current buffer will becoiae an auxiliary buffer 
and buffer x will become the current buffer. 
Initially the editor has buffer as the current 
buffer. 

3| CHANGE coaniand. 

a) A1 ,A2 C-text- 

Lines in the current buffer A1 through A 2 are 
delated. The editor accepts text which is 
substituted in place of the deleted lines. The 
value of '.* is set to the last line inputted. 
The line number of A1 must be less than or equal 
to the line number of A2. 
h) A1 C-text- 

is identical to • A 1, A1 C-text-' . 

c) C-text- 

is identical tc '.C-text-', 

4) DELETE coBoand. 

a) A1 ,A2 D 

Lines A1 through A2 are deleted. The value of '. • 
is set~to the line after the last line deleted. 
The line number of Al must be less than or equal 
to the line number of A2. 

b) Al D 

is identical tc 'AlrAlD'. 

c) D 

is identical to '.D'. 

5) EXECUTE command. 

a) Ex 

The editor will execute CTSS commands out of 
buffer x. The execution is done four at a time. 
The current state of the editor is saved during 
the execution of a command in a temporary file 
PBOGN SAVED, where PHOGN is the users programmer 
number. The CTSS commands are taken one per line. 
Blank lines ace ignored. No abbreviations are 
allowed. The core image left by every fourth 
conmand executed is destroyed fcy the restoration 
of PROGN SAVED. The value of '.' in the current 
buffer and in buffer x is not changed. 



CTSS EBCGRAMMER'S GUIDE Section AH. 3. 09 6/69 



6) FACTS command. 

a) Fx 

The contents (if any) of buffer x will be replaced 
by the following six lines: date, time, problem 
number, programmer number, system naae, and 
console id. The value of '.' in the current 
buffer is not changed. The value of ••• in buffer 
X is set to 0. 

7) GLOBAL coaaand. 

a) A1 ,A2 Gc/regular expression/ 

Lines A1 through A2 are searched for text matching 
the regular expression. For every line found 
containing the regular expression, the QBD coamand 
c will be executed, (c may only be 'p*. »d«, 'zO', 
•z1», •z2', '=', or •:•-) The character '/' need 
not be used to delimit the regular expression. The 
first character after the command character will 
be used as the delimiting character. The value of 
•. • will be set to the last line searched. 

b) Al Gc/regular expression/ 

is identical tc • A l,AlGc/re/' 

c) Gc/regular expression/ 

is identical to •1,$3c/re/*. 

8) INSERT command. 

a) A I-text- 

The editor accepts text which is inserted before 
the line addressed. The value of '.' is set tc A. 

b) 1-text- 

is identical tc '.I- text-'. 

9) SORT command. 

a) i1,A2 K 

Lines Al through A2 in the current buffer are 
sorted according tc their assending ASCII colating 
order. The sorting time is 20* (A2-Al)**2 micro 
seconds. The vilue of '.* is unchanged. The line 
number ot Al must be less than or equal to the 
line number of A2. 

b) Al K 

is identical to •A1,A1K'. 

c) K 

is identical tc •1,$K'. 

10) LIST coaaand. 

a) Lx n1 n2 {cr ) 

The editor will read file type x (x="a" for ASCII, 
"s" for line marked six-bit, "t" for line- marked 
12-bit files) with CTSS name 'n 1 n2' and print it. 
If n1 or n2 are missing, ASCII files have the 
default name 'ASCII', 6-bit files have the default 
name «FAP', and 12-bit files have the default name 
• (MEMO)'. The value of ». • is unchanged. 



CTSS FBCGHAHMER'S GOIDE Section AH. 1.09 f>yk<i 



1 1 ) HOVE command. 

a) i1,A2 Hx 

Lines J1 through A2 will be moTed to buffer x. The 
old contents of buffer x will be deleted. The 
lines maved will no longer be in the current 
buffer. The value cf '. » in the current buffer 
will be set to the line after the last line moved. 
The value cf •. • in buffer x will be set to 0. 
Absolute line numbers of lines moved will also be 
moved. If x is the current buffer, this conmand 
is treated the same as M^Al-ID A2+1,$D». The line 
nuiiber of Al must be less than or equal to the 
line number of A2. 

b) A1 MX 

is identical to •Al,AlMx'- 

c) fix 

is identical tc '.Mx*. 

12) OPTICN command. 

a) 0- list- (cr) 

The option command is used to set internal options 
or modes of the editor. The list consists of any 
number of the following: 

i) 'S* sets the editor input mode to convert all 
lower case letters in the command stream tc upper 
case. Other characters are not affected. This 
option is automatically set when a type * s' file 
is mentioned in 'L«, 'R*, or •»• commands. (Note 
that all. characters in the conoand stream are 
affected, nat just the characters typed at the 
console. ) 

ii) '!• will set the editor input mode back tc 

normal. This option is automatically set when a 

type 'a* or 't» file is mentioned in *L* , 'B«, or 
' W' cootmands. 

iii) '0* will remove the special meaning of the 
characters '('» ')'» '**» 'l*» '{*» ' }' » '•*» '*•» 

and •"• in regular expressions* The special 
meaning is restored locally by preceding the 
characters by »\C'. 

iv) •!• will restore the special meaning of the 
nine control characters in regular expressions. 
The special meaning of the characters is locally 
removed by preceding the characters by *\C', 

V) 'Bx* will give the character x the same meaning 
as •\B'. If X i3 a blank or a carriage return, any 
previous use of 'Bx' is removed. 



CTSS EBCGRAMMER'S GUIDE Section AH. 3. 09 6/69 8 

vi) 'Cx* will give the character x the same 
ffieaning as 'NC '. 

vii) 'Px' .* 'XF*, 

viii) 'Ex' .. '\E«. This option is preset to the 
number sign, (t) 

ix) 'Wx' .. 'NH*. 

X) 'Kx* .. '\K». This option is preset to the 
conmercial at sign. (3) 

xi) 'Rx' .. 'VR' . 

xii) •pi* will s®* ^ printing option to preceed 
all lines printed with their absolute line number- 

xiii) 'pa* will set a printing option to preceed 
all lines printed that have undefined line numbers 
with an asterisk. When two lines are printed with 
defined, ncn- sequential absolute line numbers, an 
asterisk is inserted between the lines, 

xiv) »pn' will set the printing option back to 
normal. 

XV) 'V (verbose) will cause QED to print any 

unexecuted commands after detection of an error 

while expanding a tuffer. This is a useful mode to 
use while debugging QED programs. 

xvi) 'q* (quick) will set the 'V option back to 
normal . 

xvii) 'd« (forbid) will cause CED to reject any 
incomming iater-console messages. The PBEN/PBOBN 
of anyone sending an interccnsole message is 
printed, but the command •WRITE' is not called. 

xviii) 'a' (allow) will cause normal acceptance of 

inter-conscle messages. 

xix) 'md** (mode) will cause QED to create any 
files in mode d*. (where d* is any number of octal 
digits.) 'OmlOl' will set the file mode to 
EFCTECTEC/READ-ONLY and 'Om1« will set the file 
mode to lEMPORARX. 

13) ESIUT command, 
al A 1 A2 P 

Lines A1 through A2 will be printed. All 

characters that have no graphic representation on 
the printing console are printed according to 



nT<:c DorkCD A MMP» • <; flliTDF «;p>fTtif»n AH-3-09 f>/69 













MULTICS esca 
that land on 


pe conventions. Two or iKire spaces 
a tab stop will be printed as a tab. 




This coavention 
are assumed set 
value of '. ' is 


is used to speed printing. (Tabs 
at columns 11, 21, 31, .-.) The 
set to the last line printed. 


b) 


A1 P 

is identical 


to 


•AI ,A1P». 


c) 


P 

is identical 


to 


♦.P* , 


d) 


ai (cr) 

is identical 


to 


•A1P'. 


9) 


(cr) 
is identical 


to 


•.+ 1P'. 



^H) CUIT command. 

a) Q 

The editor will return to CTSS coamand level 
through the use of the CTSS routine •CHNCOM'. 

15) READ coffirand. 

a) A Rx n1 n2 (cr) 

The editor will read file type x (x=a, s, t) with 
CTSS name »nl n2» and insert it after the line 
addressed. The value of '.' is set to the last 
line read. 

b) Px n1 n2 (cr) 

is identical to 'iRx n1 n2 (cr) •. 

16) SUBSTITUTE cofflaand. 

a) i1,A2 S/regular expression/string/ 

Lines A1 through A2 are searched for all 
occurrences of the regular expression. In general, 
the string is substituted for each occurrence. 
The value of '.' is set to the last line searched. 
The line number of A1 must be less than or equal 
to the line number of A2. 

The specific action of the substitute command is 
best described as follows: 

i) The next line is searched and all sequences of 
characters that match the regular expression are 
noted. If the search is done, stop. There are N1 
such sequences where N1 is greater than or equal 
to zero. 

ii) If N1 is zero then go to i). 

iii) Of the N1 sequences, pick the sequences that 
end farthest to the right on the line. There are 
N2 such sequences where M2 is greater than or 
equal to one and less than or equal to Nl. 



CTSS PBCGHAMM£B»S GUIDE Section AH-3.09 6/69 10 



iv) Of the N2 sequences, pick the sequence that 
starts farthest to the left. This sequence is 
unique. This unique sequence is replaced by the 
string to be substituted as described below, 

V) Of the original N 1 sequences, remove all 
sequences that end farther to the right in the 
line than the unique sequence begins. This will 
give a new N1 that is at least »2 sequences less 
in Q umber. 

vi ) Go to ii) . 

During each substitution (step iv) the following 
characters in the string to be substituted are 
recognized and treated specially. 

i) '6' is replaced by the unique sequence to be 
substituted. 

ii) •!• is replaced by a character of the unique 
sequence as fellows: If the unique sequence is N 
characters long, the string to be substituted for 
the unique sequence is scanned )i tioes. Cn each 
scan, each character *!• is replaced by each 
character in the unique sequence in turn. 

iii) A character that has been used to nane a 
sub-regular expression in the regular expression 
(with braces) is treated as follows: The 

character is replaced by the sub-sequence of the 
unique sequence that matched the regular 
expression. If the sub-regular expression was not 
ma4:ched, the character will be replaced by a null 
sequence. 

examples: 



command 


text 


result 


s/a/b/ 


abcdabcd 


bbcdbbcd 


s/cat/BS/ 


cat 


catcat 


s/-. ♦$/!/ 


abcde 


abcde 


s/-.*$/li/ 


abcde 


aabbccddee 


s/cat/!&/ 


cat 


ccatacattcat 


s/cat/e/ 


cat 


cat 


s/c{a }xt/x/ 


cat 


a 


s/{{ c}w{ a}x[ t}y}z/zyxw/ 


cat 


cattac 



b) SI S/regular expression/string/ 

is identical to 'A1 ,AlS/regular 

expression/string/*. 

c) S/regular expression/string/ 

is identical tc '.S/regular expression/string/'. 



C ^r~*- i r^r> &H 1 flQ f> / f^ Q 11 



17) TBAP coBnand. 
a) Inx 

The editor sets up buffer x to te expanded when an 
error of type n is detected. (Error numbers are at 
the end of this paper.) A subsequent • T* cooniand 
for a particular error number will override all 
previous settings for that error number. After the 
expansion cf a buffer for an error, any errors of 
the same type will not cause buffer expansion- The 
expanded buffer can, of course, contain another 
• T' cooaand to allow buffer expanding on another 
error. A trap can be 'unset' with program control 
by setting the trap to expand buffer octal zero. 
(Example tc 'unset' trap four: 'TUxOOO' .) Buffers 
•carriage return' (oc t 012) and 'octal zero' (oct 
000) cannot be used as trap buffers. This command 
is meant mainly for QED programs and not for 
normal editing. 

13) AUDIT command, 
a) Ux 

will replace the contents of buffer x with a QED 
edit that will reproduce all editing done on the 
current buffer since the last read on the current 
buffer. The value cf '.' in the current buffer is 
not changed. The value of ',' in buffer x is set 
to 0. Buffer X becomes the current buffer. 

19) VERIFY/SUBSTITUTE command. 

a) A1,A2 V/regular expression/string/ 

is the same as the substitute command except that 
before each substitution, the line is printed with 
the found regular expression in red case. If 
substitution is to taJte place, an 's' must be 
typed at the console. Anything else will be taken 
as an indication that substitution is not to take 
place. No erase, kill, word erase, or escape 
processing is done on the response line to this 
cosmand. 

b) Al V/regular expression/string/ 

is identical to ' Al ,A1 V/regular 

expression/string/' . 

c) V/regular expression/string/ 

is identical to '.V/regular expression/string/'. 

20) NBITE command. 

a) A1,A2 Hx n1 n2 (cr) 

Lines Al through A2 will be written on file type x 
(x=a, s, t) with CTSS name 'n1 n2'- If no file 
exists with that name, one is created in permanent 
mode. (Alternate modes are possible with the »m' 
option of the OPITCN command.) If a file exists 
in a writable mode, it is first truncated to zero 
length and then rewritten. The contents of the 



CTSS EPCGRAMnEB'5 GUIDE Section AH. 3. 09 6/69 12 



buffer are not changed. The value of •.' is not 
changed. Ihe line numbar of A1 must be less than 
or equal tc the line number of A2. 

b) A1 Wx n1 n2{cr) 

is identical tc 'Al,AlWx n1 n2(cr) *. 

c) Wx n1 n2 (cr) 

is identical to •1,$Wx n1 n2(cr)*. 

21) BUFFER LIST CD««and. 

a) X 

The editor will list the name and length (in 
lines) of every buffer previously mentioned by the 
user in B, E, f, M, or U commands or in buffer 
expansion with the '\B« character. The first 
buffer listed is the current buffer. The value of 
• . • is not changed. 

22) CANONICALIZE coniBiand. 

a) A1,A2 ZO 

All overstruck characters on lines A1 through A2 
are reordered according to their ASCII colating 
sequence. Trailing blanks and tabs are renoved. 
This operation is autona tically done to every line 
read from the console. The value of ••• is set to 
A2. The line number of Al must be less than or 
equal to the line number of A2. 

b) Al ZO 

is identical to *A1,A1 Z0». 

c) ZO 

is identical tc •. ZO*. 

d) A1,A2 Z1 

Lines Al through A2 will undergo the ZO transform 
and then two or more spaces that land on a tab 
mark are converted into a tab. (Tab stops are 
assumed set at columns 11, 21, 31, ...) The line 
nuBber of Al must te less than or equal to the 
line number of A2. 

3) Al Z1 

is identical to •A1,A1Z1". 

t) Z1 

is identical tc *.Z1'. 

g) A1,A2 Z2 

Lines Al through A2 will undergo the ZO transform 
and then all tabs will be converted to the 'right* 
nuiBber of spaces. (Tab stops are assumed set at 
columns 11, 21, 31, ...) The line number of Al 
must be less than or equal to the line number of 
A2, 

h) Al Z2 

is identical to »A1,A1Z2». 

i) Z2 

is identical tc •.Z2'. 



CTf?s FRORBAMMER'S Gil TCE Section AH. 3.09 6/69 13 



23} RELATIVE LINE NOMBBR comffland. 

a) A = 

The editor will print out the relative line number 
of the addressed line. The value of '.' will be 
set tc A. 

b) = 

is identical to •$*'. 

24) ABSOIDTE LIME NUMBEB command. 

a) A1 : 

The editor will print out the afcsolute line number 
of the addressed line. The value of •. • will be 
~ se t to A . 

b) : 

is identical tc »$:'. 

25) COMMENT comaand. 

a) " 

The editor will skip all characters up to and 
including the next carriage return. 

IICTES 

The characters •{', '}'» '\' ^^^ '~ ' ^^^ idealized versions 
of the ASCII left brace {oct 173), right brace (oct 175), 
back slant (oct 13U) and circumflex (oct 136) respectively. 
To input these characters from different devices, normal 
MOLTICS escape conventions apply. (See Multics Systems 
Programmers' Manual Section BC,2.0U.) 

If a semicolon is used tc separate addresses instead of a 
3omma, the value of ••• is set to the address immediately 
preceding the semicolon. This makes V8E/,/RE/+ 10' identical 
to '/BE/;.* 10'. The second example is more efficient. 

If more addresses are preceding a command than are required, 
only tha last addresses are used. 

All letters recognized by the editor are recogni2ed in both 
upper and lower case. 

While the editor is accepting commands, blanks that are not 
in regular expressiDna or strings are ignored. Note that the 
buffer name inmediately following 'T', 'B', 'E', 'F', •«•, 
•U », or 'XE* is a string. 

In most cases, preceding a spe:;ial character by 'NC will 
ramova tha special meaning from the character. The one 
exception to this rule is that one cannot search for a 
carriage return in a regular expression. 

Hitting the interrupt button once will immediately drop 
recursion to 0. The editor will then be ready to accept 
commands from the console. 



CTSS PROGRAMMER'S 3UIDE Section AH. 3.09 6/69 14 

An address search for a regular expression that fails will 

Irop buffer recursion by one. If recursion is at level 

(commands being taken from the console), an error is noted. 

An absolute line address for which there is no absolute line 
is treated as an error. 

There is no safeguard to keep the editor froia editing a 
buffer that it is using for edit commands. If this is ever 
done, havoc can be expected. 

QED can be called with any number of paraaeters. If it is 
called with no parameters, the editor will take coamands 
from the console. If it is called with parameters (say PI P2 
Pn) then the fcllowing edit will appear in buffer •••: 

bO 

ra PI QED 

\bO 

P2 



Fn 
The editor then simulates 'XB. • typed at the console. This 
allows a bootstrap edit to be executed out of buffer 0. 

QED will set inter-ccnsole communications permission from 
tha file 'USEP PBOFIL'. If an inter-console message arrives, 
QED will save its current status in a temporary file FfiOGN 
SAVED and call the CTSS command WHITE. When WRITE retijrns, 
PHOGN SAVED will automatically be restored with no changes 
in QED. 

All taxt is kept in core. Core storage limits the maximum 
size of text that can be around. This maximum is about 20 
disk tracks of text. In lines, it is between 2000 and 3000 
depending upon density. 

COHMESTS 

The ideas for QEC have come from a variety of sources. The most 
notable are lYPSEI at MAC, and QED at U. of Calif. 



CTSS PHCGBAHMER»3 GUIEE 



Section AH, 3.09 



6/69 15 



SUMMARY 



QED COMMANDS 










Coffffiand 


Function 




Value of «. » 


(1) 


A text 


append 




last line input 




Bx 


buf fee 




previous • .* for this b 


(...) 


C text 


change 




last line input 


(. r.) 


D 


delete 




line after last line de 




Ex 


execute 




unchanged 




Fx 


facts 




'.» of buffer x set to 


(1,$) 


Gc/re/ 


global 




set by last c executed 


{.) 


I text 


insert 




unchanged 


(1 ,i>) 


K 


sort 




remains on same line. 




Lx n1 1)2 


list 




unchanged 


{- ,. ) 


MX 


move 




after last line moved. 




0- list- 


option 




unchanged 


(. ,.) 


P 


print 




last line printed 




Q 


quit 




unchanged 


ii) 


Bx n1 n2 


read 




last line read 


{., .) 


S/re/st/ 


substitute 


last line searched 




Tnx 


trap 




unchanged 




Ux 


audit 




unchanged, in x to C 


{.. .) 


V/re/st/ 


ver if y 




last line searched 


.i) 


Wx n1 n2 


write 




unchanged 




X 


status 




unchanged 


{. ,.) 


20 


canonical 


ize 


last line canonicalized 


(., .) 


Z1 


canonical 


ize 


last line canonicalized 


(. ,.) 


Z2 


canonical 


ize 


last line canonicalized 


(S) 


• 


absolute 


line 


addressed line 


{*) 


= 


relative 


line 


addressed line 




n 


coaaent 




unchanged 



buffer 



in x to 



SPECIAL CHARACTERS 

\Bx axpand buffer x (=o030) 

\C ascape next character (=o0 31) 

\F end of text {=c034) 

\E character erase {=o032) 

\W word erase (=o037) 

\K line erase (=3035) 

\R expand console line (=c036) 



ERROR MESSAGES 



?0 
?1 
?2 
?3 

?t4 



CED internal table overflow 

address search typed at console that fails 

illegal ccnaand or address 

illegal syntax in regular expression 

interrupt 



CrsS PPCGRAKMER'5 GUIDE Section AH, 3.09 6/69 16 



?5 address reference out of buffer 

76 n, D, S, V, 3r Z commana with addresses that 

cross line 0. (ie 5, 2C) 
?7 isaxiiEucB recursion level reached 

?3 file cannot be opened. This includes reading a 

ncn-existant file, writing after track quota 

is reached, writing a protected file, etc 
?9 illegal format for a command. This includes an 

illegal file type (not a, s, t), unrecognizable 

option in option connand, etc. 



(END) 



CTSS PHOGBAMMEa'S SUTDE .S«»rT ti on aH-l.lO 19/ftQ 



Identification 

Edit ASCII files 

EDA 

Purgoss 

EDA is a context-editing program for ASCII character stream 
Eilas. Almost all of the EDA command's operation is 
identical to that of the TYPSET command (see AH, 9. 01) . 



Usaje 



EDA naael naine2 

EDA will edit the ASCII file "namel name2". Editing 

conventions are identical to those of the TYPSET 
conmand, except that input and output is in the 
ASCII Character set with the normal Multics 
conventions, and the ••break" line used to transfer 
between input and edit modes is a line consisting 
of a siagle period instead of an empty line. The 
'break' request is not implemented. 



(END) 



^T^q PRnf5RAHMER « s SDTDT? Section AH-3-11 12/69 1 



i^gB^ificatioTi 

Mova d file; Append one file to another 
MOVE; APND 
N. I. Morris 

P u r £0 sa 

MOVE may be used to copy a file from disk onto file system 
tapa or to read a file from file system tape onto the disk. 
In addition, MOVE can be used in the same manner as TBNSHT 
SAVED to move a file through a link. APHD is used to append 
one file to another. 



Usajge 



MOVE NAME! NASE2 H&ME3 -IIAME4- 
APND NAHB1 NABE2 HAME3 -KAMEU- 



NAME1 NAME2 is the nane of the file to be MCVEd or 
AENDed. 

NAME3 liABEa is the name of the file to be written. If 

NAMEU is emitted, SAME2 is assumed. If NAME3 
is «♦', NAME1 is assumed. 

Execution 

NAME1 NAnE2 is opened for reading and NANE3 NAMEU is opened 
for writing. (If MOVE is being used, SAME3 BAME4 is 
truncated to zero-length.) Then, the contents of NAHEl 
NAME2 are copied into (or appended to) SAME3 NAME4 by a 
high-speed file copying routine. This copying routine is 
triple-buffered so that tape to disk and disk to tape 
copying can actually run two data channels simultaneously. 
Note that the file NAME1 JIAME2 is unaffected by MOVEing or 
APNOing. 

W ri tin.g[_'rape Files 

A file may be MOVEd from disk to tape by the following 
sequence of commands. (Assume that the tape has already 
been MOUSTed and LABELed. ) 

TAPFIL HAHE3 NAMEU DNIT 
HOVE NAME1 NAHE2 MAHE3 KAHEU 

fi2 ai i fll _I5£® -111 §S 

The first time a freshly TAPFILed tape file is read, several 
words of garbage may be appended to the last record of the 
fil3. This is caused by a paradox in the file syste*. (The 
first time a tape file is read, the file system doesn't know 
the correct length of the file. After the entire file is 



CTiJS EFCGRAMMEB'S GUIEE Section AH. 3. 11 12/69 2 

raaa once, the correct length will be updated into the file 
system,) MOVE will campensate for this file-system problem 
by deteraining the correct length of the file and ignoring 
ths garbage words. Thus, MOVE should always be used to read 
a tape file for the first time. To HOVE a file from tape to 
disk, use the following sequence: 

TAPFIL NAME1 8&ME2 UNIT FILE 
MOVE MAME1 NAME2 NAHE3 BAMEU 

References 

Section Hi ME 

AG. 5. 05 Use of tapes in foreground 

AH. 3. 06 rape-handling comiaands 



(END) 



i-Ti:c aannQKMmv.a *ci f;iiTnR Section AH. 3. 12 12/69 1 



i d e n t i fie at i en 

Context editor foe cacd-iaage files 
EDC 

Pur225S 

To allow editing of f ixed-length-recor d (lU word card image) 
files with EDL/TYPSET editing conventions, and provide 
slightly greater flexibility than is offered by ED. 

Usacje 

Editing conventions are identical to those of EDL, with the 
following exceptions and additions: 

Tha 'break • request is not implemented. 

Whan aditing a file with name2 .e. HAD (or HADTBN), a colon 
{":••) in cclunin 12 (or 7 with MADTRN) immediately following 
a tab is treated as a logical backspace, i.e. the next 

character appears in column 11 (6) on the card. All other 
colons are treated as ordinary text. 

MCOLS n (abbrev. NC) 

Sets the number af card columns available to text. 611 
columns after 'n* are blanked, except that card 
sarialization may occupy columns 76 to 80. 'n' is 
initially set to 72, and may be changed to any value 
between 1 and 84. Setting WC to any numbar but 72 will 
reset serialization to OFF; to restore serialization, 
use 'SERIAL ON' (see below). 

TAflSET n1 n2 n3 ... (abbrev. TB) 

Informs EDC that tabs are to be interpreted as skips to 
the columns specified. For HAD files, tabs are 
initially set at 12, 17, 22, 27, etc.; for FAP files, 
tabs are initially set at 8, 16, 30, and every 4 
columns thereafter; for HADTHN files tabs are initially 
sat at 7 and every 5 columns thereafter. For all other 
files, tabs are set at every column (i.e. a tab becomes 
one space) . 

Tabs inserted into the current line will print as tabs; 
tabs in any athec lines will print as the apEropriate 
number of spaces. 



CTSS EBCGBAMMER»3 GUIDE Section AH. 3. 12 12/69 2 



SERIAL m n (abbrev. SB) 

SERIAL OFF 
SERIAL CM 

Tha file will be resejuenced in card col. 76-80, 
starting at •m", incrementing by 'n ' , beginning at the 
current line. Besegaencing is repeated on every pass 
through the file (i.e. after a 't' request). If 'OFF' 
is specified, sejuencing is discontinued; the 
sequencing field will be blanked (or will contain data 
if NC . G. 76), beginning with the current line; 
sequence nunbers will be removed on successive passes 
through the file. If 'ON* is specified, sequencing 
will be resumed from where it was discontinued; the 
entire file will again be resequence! on successive 
passes after 't* requests. This option is initially set 
to 'SERIAL 10*. 

^^striction 

Do NOT use EDC if it is desired to preserve existing 
saquanca numbers in a file, except with 'HC 84*, being 
careful that substitutions dc not push col. 73-80 off the 
and of tha line. 

EDC is somewhat inefficient, and is not recommended for 
editing very large files (i.e. several hundred records or 
more) . 



(END) 



r<nor< n&MM t?D i;: r^ii T T1 P ^<artinn AH.U-01 6/69 1 



f I1^/V7 l.taLJI.IJ 



I d en t i f i cation 

Combine seldom-used files 
ABCHIV 

Purpose 

To -ombine files which are not frequently used so that the 
single archive file occupies fewer records than the many 
sinallar files. The average saving is half a record per 
file. Individual files may be combined, listed, printed, 
ialatad and recreated. 

5 jstrictions 

An archive file may contain files of any name, but unless 
th- secondary name of the archive file is "SOUBCE" or 
"ASCHIV", files in the archive whose secondary name is 
different from the archive file«s secondary name cannot be 
rafaranced. For example, if the archive "ALL MAD" contained 
"XXX FAP", XXX could not be extracted without renaming the 
archive. 

It tha second nasae Df an archive file is "SOURCE" or 
"ARCHTV", the arguments FILl ... are taken in pairs to 
rjpresant primary and secondary names of files to be 
operated on. Otherwise, the arguments are taken singly, and 
represent primary names cf files which have secondary name 
tha same as the archive. 

Filas to be deleted are deleted by the library subroutine 
DELETE. Its conventions are restated under Wethodjs. 

Usage 

ABCHIV KEY NAMEl NAME2 FILl ... FILn 

KEY=C: Combine files BIL 1 NAHE2 ... FILn NAME2 into 
an archive file SAMEl NAHE2. Any old files 
NAME? NAME2 will be deleted, if possible. 
FIL*s are not deleted from the user's file 
directory . 

KEY=P: Print file(s) FILl ... Flin which is (are) 
contained in archive file NABEl MAME2. Card 

image and standard line-marked files may be 
printed. 



KEY=r 



Print a table of contents of archive file 
MAHEI HAI1E2. If FILl ... FILn are specified 
only these will be listed. 



KEY=TCFF: Like "I", but writes , the table of contents 
into the filey'AHCHIV OUTPUT", a line-marked 
six- bit file. 



CTSS PHOGttAMHER 'S 3UIDE Section AH. 4.01 6/69 



KEY=D: Delete FILI ... FILn from the archive file 
MAHEl UAME2. Ihis involves craating a new 
archive file and deleting the old one with the 
standard hccus poc us of deleting. 

KEY=X: Extract and cofy FILI ... FILn from archive 
file NAMEl NAMf2. The copy is named FILi NAME2 
and any old copies are deleted. 

KEY=XT: Same as X except that the file is extracted in 
•teaparary* mode. 

KEY=H; Replace each FILi in the archive file BAME1 
NAME2 with a copy of the file PILi NAME2- This 
involves creating a new archive file and 
delating the old one. If no FILi exists 

within the archive file, a message is printed 
and the command is executed as ABCHIV C NAHE1 
MAnE2 MANE 1 FILi. 

KEY=BD: Same as B except that after the new archive 
file has been successfully created and filed, 
all the files which were placed into the 
archive are deleted. 

KEY=U: The files specified are replaced in NAHE1 
NAME2 if the copy of the file in the user's 
directory has 'date and time last modified* 
greater than the date and tise the 
corresponding entries were placed in N&HEI 
HAME2. If no FILi»s are specified, all the 
entries in MAflEI HAnE2 are updated in this 
na n ne r . 

Whenever no FIL*s are specified in the comnani call, unless 
KEY=D, the coBoand is taken to be universal, i.e., as if 

the call had included every entry in the archive. 

Hi thai 

Bich antry in the archive file consists of a header, in 
which file name, date and time last update, and the number 
ot words in the file are indicated, followed by a copy of 
the file. The word count in the header makes it unnecessary 
to pad the file, so that the file can be reproduced 
absolutely faithfully. 

The header is 1U words long, consisting of four words of 
(777777C00000) 8, one word of (777777000011)8, and nine words 
of self-explanatory BCD information about the file. Thus a 
program which does net recognize line marks can still read 
the archive file (since th,e-^ader is 1 «♦ words long), but 
programs which do recognise line-jnarks will see the header 
as four null records (carriage returns) plus the file entry 



rTq<; P»nart»MMER »5; SUtDE Section AH.U.OI 6/69 



information. If card image files are ABCHIVed, the header 
record will cause same programs to abort because of illegal 
file forifat since there hill be a mixture of line marks and 
:;iri images (e.g. disk, editor). 

Whenever ARCHIV creates a new file, it is first named 'prob 
prog'- where prob is the user's problem number and F^^OQ is 
the' user's programmer number and prog is the user's 
programmer number. After this file is created, the file 
which it replaces, if any, is deleted and file 'prob prog' 
is renamed and the mode changed to permanent or to the mode 
of the old file if it existed. 

Files to be deleted are handled in the standard DELETE 

minner, i.e., verification is requested for protected, 

private, read-only, etc., files. If a file cannot be 

deleted, the new file may be found under the name 'prob 
prog • . 



(END) 



rTSS PRnGHAMMER • S :;iJIDE Saction AH. 4.02 Paae 1 



I^entif icaticn 

Compress BCD files 
CRUNCH 

Purposa 

To compress a BCD file in such a way that it occupies less 
lisk spaca and, iacident ally, is in a form acceptable as 
input to BEFAP. 

Usaje 

Crunch: 

CRUNCH 'CR' NAME1 -NAME2- -'PUHCH'- -•72COLM'- 

CR directs the crunching of file MAME1 NA«E2 into 
a file NAME! C8USCH. If NARE2 is omitted it is 
assumed to be PAP. 

PUNCH directs the crunching of file NAME1 NAHE2 into 
a file NAME1 PUMCH which is in a form suitable 
for BPUNCH with RQUEST. 

72CCLM directs the crunching of only coluans 1-72 of 
the source file. This results in additional 
space saving and the sequence numbers may be 
reconstructed during uncrunching. 

The order and presence of PUNCH and 72COLn are 
optional. 

Uncrunch : 

CRUNCH 'UN' NAME1 -SAHE2 •PUNCH'- -«NUMBER«- -MAJ- -SEQ- 

UN directs the reconstruction of the source file 
NAME1 NAME2 from the crunched file NAMEl 
CRUNCH. If NAflE2 is omitted, it is assumed to 
be FAP. 

PUNCH directs the uncrunching of NAMEl PUNCH rather 
than NAMEl CRUNCH. 

NUMBER directs the reseguencing of the source file 
NAMEl NAME2. In the absence of MAJ and/or SEQ, 
the first three non blank characters of NAMEl 
will be used in cols 73-75 and sequencing will 
begin with zero with increments of ten. The 
order of 'PUNCH' and ' NUMBEE' is optional. 

MAJ if si;ecified in conjunction with 'NUMfiER', the 
first, three ubn blank characters are placed in 



CTSS PHOGRAHMER'S GUIDE Section AH. 4. 02 Page 2 

columns 73-75 of tha source file NAME1 NAME2. 

SEQ if specified in conjunction with 'NUMBER', 
causes sequencing to begin with SEQ. The fixed 
increment is ten- 

Print: 

CRUNCH »Ptt' NAMEI -'PUNCH'- -'NUHBER*- -LABEL- -S EQ- 

PH directs the printing of NABB1 CRUNCH 

PUNCH directs the printing of KAMEI PUNCH rather 
than NAME1 CRUNCH. 

SEQ is numeric to specify tegin printing with card 
of sequence number SEQ. 

NUJIBER SEC begins the printing with alter number SEQ 

LABEL is alphanumeric to specify begin pointing with 
card containing LABEL in columns 1-6. The 

sequence numbers will appear on the left of 
the listirg. 

NUHBER LABEL begins the printing with the card 

with LABEL in cols. 1-6. The alter numbers 
will be printed on the left of the listing. 



(END) 



rT<;e: DRnrzoa mmp.r » q r:nTnE Section AH. 4. 03 12/69 1 



I^Jg£tif icaticn 

File compression and expansion 
SQUASH, XPAliD 

P urgosa 

SQUASH ccnvetts a card-iaige file to a 6-bit linemarRed 
fil2. XPAND converts a linemarked file to a card-image 
file. 

Usa^e 

SQUASH HAME1 NAME2 NAME3 -MAMEU- 

XPAND MAMEl NAME2 NAME3 -HAME**- 

At least three arguments must be given to SQUASH or XPAND. 

NAHE1 KABE2 is the name of the file to be converted. 

SAME3 is the primary name of the file to be 
created. NABE3 may be the sama as NAME1, if 
desired, but it must be explicitly typed. 

NAME«4 is an optional secondary name for the created 
file. If NAHEU is omitted, HAME2 will be 
used as the secondary name. 

SQUASH converts 6-bit card-image files to linemarked 
format. 

If NAME2 is "EAP", a tab will replace one or 
mere blanks immediately ahead of columns 8, 
16, and 3C. 

If NAriE2 is '•MAD'*, a tab will replace blanks 
appearing immediately before column 11 or 12: 
a character appearing in column 11 is 
preceded by a colon (logical backspace) . 

If NAME2 is not "MAD" or "FAP" no tabs are 
inserted. In all cases, trailing blanks are 
stripped off and columns 73-80 are discarded. 

Experience with a variety of FAP and MAD 
programs indicates that a saving of from 60% 
to 75* of storage space is typical. 

XPAND converts linemarked files to card image 
format. 

Tab interpretation is based on the secondary 
name_cf the file to be craatad. If the 



CTSS FBCGBAMMER'S GUIDE Section AH.y.03 12/69 2 



secondary name is not FAP or MAD, tabs in the 
file are left uninterpreted. 

If the secondary name is "FAP", tab stops are 
assumed at columns d, 16, 30, and every four 
columns thereafter. 

If the secondary name is "MAD", a tab stop is 
assumed at column 12 and every five columns 
thereafter. If a colon appears in ccluan 12, 
it is discarded and the next character moved 
back to column 11 of the resulting card. 
Serialization by "ones" is placed in columns 
75-80. 

If tab interpretation results in a card image 
greater than 72 columns, the card will be 
truncated, and printed out with an 

appropriate comment. 



(END) 






Identification 

Compress and expand BSS files 
PADBSS and SQZBSS 

Purgosa 

To compact bSS files by a factor of 2 in order to save disk 
spas 3. 

Usaje 

SQZBSS ALPHA -BETA- 
FAEBSS ALPHA -BETA- 

SCZBSS will create a file named BETA SQZBSS. All zero 
words and card sequencing will be stripped off 
the card images. 

PADBSS will read file 'ALPHA SQZBSS* and recreate file 
•BETA BS3«. 

If BETA is omitted, ALPHA will be used. 

Checksums are computed and compared against the 
checksums on the cards. If a discrepancy is 
found, an error comment will be printed, 

SQZBSS decks may be laaded using the LAED loader by typing: 

LAED LOAD (SQZ) 8ABE1 ... NAMEin 

whara NAKEl ... NAMEla are the primary names of n SQZBSS 
files. To load SQZBSS and BSS decks intermixed use: 

LAED LOAD (SQZ) NAME1 (BSS) NAME12 MAKE13 

(The coBiiands LOADGO, NCLOAD , and VLCAD may be used in place 
oE LOAD.) see also AH. 7. 04. 



(END) 



miTrir Co/-*-ir»n IHaOS f./f,Q 



Ijantif icatiqn 

Ar=hiv3 ASCII files 
AARCHV 

Purpose 

AARCHV is a versiaa 3f the AHCHIV coamand (see section 
AH. 4. 01) for files in the ASCII character set. The reason 
for having a separate command is so that archives of ASCII 
filas can be printed aff-line. The ARCHIV coniiBand scatters 
header inforeation in BCD through the archive file, which 
prints as garbage in ASCII. In addition, since ASCII files 
usually end with the character EIX (octal 003) to indicate 
tha end of the file, only the first file in a regular 
archive of ASCII files will print off-line. 



Usaa.a 



AABCHV KEY NAME1 MAME2 FIL1 ... FILn 



AARCHV is an adaptation of the regular ARCHIV command. 
See section AH.U.01 for details on its use. Only 
the differences between AARCHV and ARCHIV are 
described below. 

KEY The keys "P" and "lOFF" are not implemented. 

FILi The secondary names ••SOURCE" and "ARCHIV" are aot 
treated specially ty AARCHV. All names FILi refer 
to a file "FILi NAME2". 

Tha intarnal fornat of an ASCII archive file is somewhat 
different frco a regular archive. All name and date 
information is kept in ASCII, and the length of the file is 
given in characters. Since the AARCHV header contains a NP 
(octal 014) character, each file in an ASCII archive file 
will begin printing on a new page if the file is printed 
of f lina. 



(END) 



nuTVV c;or+-innAH-a-Oft 12/69 1 



li§.Q.lil.i.£S.li.2!l 

Craate or append to ABCHIV format files 
APENDA 

Purpose 

fo allow more efficieat addition of new subfiles to existing 
ic::tiivas, and to allow somewhat more efficient creation of 
archives. To allow creation of achives on CTSS foreground 
tapas without creating an intermediate disk file. 



ysa^e 



APENDA Ml N2 f1 f2 f3 fU ... 



Filas 'f 1 f2«, 'f3 f 4« , etc. are appended to file 'Kl N2«, 
preceded by archiv headers. 

APEMDA N1 N2 •♦» f 1 f 2 f 3 ... 

Files 'fl il2«, •f2 N2', •f3 N2«, etc. are appended to file 
•til N2', preceded by archiv headers. 

Hathod 

File 'Nl N2* is initially opened for writing. Each file to 
b2 appandad is then in turn opened, copied onto the end of 
» N1 N2', and closed. In the event of any file errors, all 
filas are closed and a diagncstic is printed. Note that if a 
f ila-not-f ound error is received while in the middle of a 
long series cf append operations, all previously appended 
filas will have been processed properly, and the operation 
can be continued later. 

Restriction 

If AFENDA is used to append a file which is itself an 
archive to another archive ( •super-archiva •) r the entire 
fila appended is treated as a single subfile. Perforning the 
same operation with the 'ARCHIV C» option results in 
extracting all the subfiles from the file to be added, and 
including these in the archiva as distinct subfiles. 
Furtharmore, using the »ARCHIV U» option to update such a 
•supar-archive* will cause all embedded archive subfiles to 
appear as distinct subfiles of the main archive. 



(END) 



r-pt:*; cnncoiMwif »tq: nnrns q or-*- -i on »h ^ m f» /au 



List contents of file directory 
LISTF 

Pur£Ose 

To provide a comiDand which lists the contents of a file 
3ir3Ctory, with nuiBer3us selectivity features if desired. 

Dascription 

LISTF enables the user to selectively list the contents of a 
fila directory by pernitting him to specify the 

1. file directory 

2. file names 

3. authors 
U. modes 

5. range of dates last used 

6. range of dates last modified 

7. sorting process 

8. output form 

to be amployed. 

The user has the option to supress the search for linked 
filas or to search only for linked files. 

Usa^e 

A. Basic 

The basic call - LISTF - will first produce a 
one-line sumisary of the number of nonlinked files 
and the number of records in the user's current 
directory. This is followed by a table of nonlinked 
files in the form 

HAME1 Nftnj2 MODE NREC DATE (last used) 

sorted according to the date last used with the most 
recent date first. This is followed by a one-line 
summary of the number of linked files and a table of 
linked files in the form 

NAMEl MAKE2 MODE (in user's directory) PSOBH PRDGN LNAMEI LNAME2 

alphabetically sorted with respect to the primary 
file name, where the last four items refer to the 
"other end of the link.*' 

B. Cpticns 



CTSS EBCGBAKHER»S GUIDE Section AH. 5.01 6/69 



The selectivity features and their usage are 
described on the pages which follow. 

Convgnticns 

1. Arguments are divided into four classes. 

a. jeta-ar^uments (defined indu::;tively from the 

Specifications Tables below) 

*>• S.2^kfi§E§ (defined inductively froa the 

Specifications Tables below) 

c. f ile^names - all arguments which cannot be 
identified as met a- arguments or modifiers 

d . S£ec ia l_c ha rac te r s 

1) carriage return 

2) ♦ 

3) ( and ) 
^) * 

2. A request is a string of arguments terminated by a 
single quotation mark ( •) or by a carriage return. 

3. A call is the coaimand LISTF followed by a string of 
raquasts and terminated by a carriage return. 

4. The order of the arguments is unimportant, aside from 
the fcllowing considerations: 

a. modifiers must immediately follow the 
meta-acgument which they modify 

b. when sorting ty dates, the list will begin 
with the first date specified 

c. two primary file names must be separated by a 
secondary name or by a meta -argument 

5. Up to 19 arguments mi y be specified in one call to 
LISTF. 

6. One interrupt level is set to enable the user to 
terminate the request being prosessei and begin the 
next. (WARNING: some output may be lost.) 

7. If the user juits when he is listing linked files in a 
cofflBon file in the long form, his directory switching 
will probably net be restored. (This condition can, of 
course, be corrected by issuing a COHFIL command.) 



rT-SS PHORHAMM RR • S f^IlTDR 



SerrtioTi AH.S.OI 



fi/fiq 



Fili_Naffles 

An astarisk (♦) embedded in a file name specification refers 
to any and all characters in that position. A single ♦ as a 
fila name means any and all naaes. 

EXAMPLES: 

CTEST* means any name with "CTEST" as the first five 
characters, i.e., crjsri , CTJSTS, but not bCTEST, where "b" 
denotes tlank. 

*TEST* means any name with "TEST" as the 2-5 characters, 
i.e., CTEST1» bTJSrs, but not bbTEST or TEST12. 

♦ * means any 1 or 2 character naae. 

IE tha secondary file name is omitted, ♦ will be assumed. 

It no fila names are specified, ♦ * will be assumed. 



CrSS EBCGBAMWER'S GUICE Section AH. 5. 01 6/69 H 

SPECiFICATION_TABLES 

SEARCH SPECIPICATIOSS 
M^TA-ARG MODIFIERS ACTION MlhMkl C0MHE1ITS 

(FILE) None ignores links 

(LIHkT" None links only 



lists all 
files 



|UFD) naite of file searches U.F.D. (FILE) 

linked to the linked 

ether U.F.D. directory 
(FILE) 

IsYsf None searches the 

public files 

IcFLnY None searches the 

user's common 
file n 

"(AUThJ author~nosT files created any author 

by specified 
author only 

"(noDiy T~cr~mcre files with any mode J^P) = 104, 

arguments, specified (HP*) = at 

each having modes only least 10U, 

1-4 of: 0,1, (B) (^) = 

S,E,W,L,P,*, 100 or OOU 

enclosed in 
parentheses 

"■(USEDf up~to~tw3 flles'with (NEwT'lCLDy" 

dates MWDDYY date used (NEW) is the 

or ' (OLD) • between present date 

or • (NEW)* the dates (OLD) is the 

specified oldest date 

"TMADif see~luSED7 fiies'with TsEwf TcLD) 

date modified see (USED) 

between 

dates given 



SOBriNG SPECIFICATIONS 

nETA-ARG MODIFIEBS ACIION DEFAULT CCflMENIS 

(SDIR) None file directory 

or der 

(SNAI) None sort on NAWE1 

(SNA2) None sort on NAME2 



(SMOD) None sort on octal 

file mode, in 
descending 
or der 



(SREC) None sort on file no links* 

size, largest 
first 



(SOSE) None sort by date no links* 

used 



(SHAD) None sort by date no links* 

modified 



(SUSE) for 
files, (SNAI) 
for links 



(REV) None reverses sorting 

crder 



♦ Listing of linked files will be suppressed in 
requests with these me ta-arg uments. 



CTSS EFCGRAHMER'S GU ID! Section AH. 5. 01 6/69 < 

OUTPUT SPECIFICATIONS 
META^ARG MODIFIERS AC II ON DEFAUil CCMMEHTS 

(LSUM) None summary lines 

only 



(LNAH) None NAME1-MAME2 

only listed 



(LONG) None nocisal form if (UPC) was 

plus date/time requested, 

nodified, auth. links listed 

device, lock in normal 

for files; mode, form 

date/time used 
and modified, 
auth., norecs, 
device for links 



(ON) None output printed 

en terminal 
(noroal node) 



(OFF) Nona output written (HDR ) is 

into file assumed 

LISTF OUTPUT 
for offline 
printing via 
•RQUEST * 



(HDR) None listing prefixed 

by date/ time, 
file directory 
name 



(NUDB) None suppresses the 

header when 
(OFF) requested 
(normal node) 



CTq.S FRnfiRAMMEfl'q QITEE Section AH. 5^01 6/69 



Example 1 

(1) (2) (3) (U) (5) (6) (7) 
LISTF * BSS 3AMMA (AUTH) 1 2 (LONG) 

(8) (9) (10) (11) (12) (13) (U) (15) 
(MODE) (HP) (W*) (AOIH) 99999 (CFL2) (USED) 090165 

(16) (17) (18) (19) 
(5DIR) (MADE) 080165 080 165 

(7) 

would produce a table in the long form, in the order 

(16) 
of the file directory, of all files with the following 
properties 

(M), (11) ,{U), (17) 

1. non- linked 

(1) r ( 2) 

2. secondary nane "BSS" and/or priiaary 

(3) 
name "GAHMA (any character)" 

(5), (6), (12) 

3. written by user no.s 1, 2 or 9SS99 

(9) 
U. in read-only, protected mode or has write-only 

(10) 
bit set 

(13) 

5. in coBBon file 2 

(15) 

6. last used on or before 9/1/65 

(18), (19) 

7. last iBcdified on 8/1/65 

where the superscripts are, of course, for reference only. 

Ejtam£le_2 

If present date is 12/31/65 and all files in the 
directory were last used between 1/31/65 and 12/31/65, 
inclusive, then the following requests would produce 
identical tables (consisting of all the non-linked files 
use! from 1/31/65 to 12/31/65, inclusive, in the normal form 
beginning with the file last used) . 



CTSS EECGPAMMER'b GUIDE 



Section AH. 5. 01 



6/69 8 



1. 


(USED) 




2. 


(USED) 


(NEii) 


3. 


(USED) 


123165 


U. 


(USED) 


(NEii) (OLD) 


3. 


(USED) 


(OLE) (REV) 


b. 


(USED) 


013165 123165 


7. 


(USED) 


123165 013165 


8. 


(USED) 


(HEW) 013165 


9. 


(USED) 


013165 (NEW) 


10. 


(FILE) 




11. 


(A UTH) 




12. 


(MADE) 




13. 


(REV) (REV) (USED) 


14. 


(SUSE) 





(REV) 



(REV) 



(END) 



r-Tcc csmti t MM PD< c: Ctl T rif Kckf*-inn att.S.n^ V^taa 



liS-Jilifi cation 

Print BCD card image files 
PRINTF 

Purjjose 

To pcint the contents of BCD card inage files 
(line-numberea) either from the beginning of the file or 
from some sfecified line number. 



Usaia 



PRINIF NAHE1 liAME2 -SEQ- 

PHINTF prints the contents of file BAHEI NAME2 by 
printing first characters 73-80 and then 
characters 1-72 so that the line numbers will 
appear on the left. 

SEQ specifies the nuaeric portion of the columns 
73-80 of the initial line to be printed. If 
SEQ is omitted, the beginning of the file is 
assumed. If SEQ does not match any line 
nuBber, the nejtt higher line number in the 
file will be used. 



(IHD) 



Ml ^ i(^f^ 



I^ent if icaticjn 

Print a BCD file 
PRINT 

Pur£osa 

To print the contents of a BCD file, which can be either 
lina-numbered or line-marked, and either 6- or 12-bit mode. 
Specific lines and special format may be requested. 
Furthsr, the command will function if the user is ATTACHed 
to another directory. 

Thare is a limit of 22 words per record for 6-bit mode 
files, and a limit of 132 words per record for 12-bit mode 

f il3S. 

UsaiB 

PRINT NAME1 NAME2 -LINES- -FIELDS- -'TAB'- ... -•TAB'- -*{?MLL)*- 

PPINT will ncrmally jrint 1 ine- nuitbered files in the 
format: characters 73-80, blank, then 

characters 1-72. L ine-mar ked files will be 
printed from character 1 through the last 
character, with 132 characters per line of 
type. 

LINES (optional) may specify which lines or records 
should be printed if other than the initial 
line is desired. The specification may be one 
of three forms: 

1) s from s thru the end of file 

2) s 'TO' e from s thru e 

3) 3 THBU* e from s thru e 

where s and e are decimal digits which are 
interpreted as line-numbers or record numbers. 
Line-numbers are matched against the 

right- Bost numeric field of card image files. 
Record numbers identify variable-length 

records by their numeric order, beginning with 
1. 

Line- numbers are assumes for card image files. 
The mode is switched to record number upon 
encountering any line-marked record. Using 

THBU instead of TO causes setting to the 

record number moda, 

FIELDS may be specified only if LINES is not void (it 
may be or 1 ) . FIELDS comprises any number 



CTSS PROGRAMMER'S SUIDE Saction AH. 5. 03 1/66 



cf pairs of decimal numbers from 1 to 132, of 
general form a1 b1 a2 b2....an bn. The 

PBINTed line will be a concatenation of every 
field specified bj the position in the record 
read frDin the file, as from the ai character 
through the bi 3hara::ter. 

Ai and bi nay be in any order, and the fields 
are independent of each other. A field nay be 
partly or entirely repeated and also printed 
in reverse order. If a specification field 
exceeds the length of a record, the outside 
characters will be set blank. If the last bn 
is Dinitted, it is assuned equal to an, 
defining a single character field. 

TAB will cause tabular spacing to occur between 

each of the fields specified in the FIELDS 
list; each additional appearance of 'TAB' will 
cause additional "tab" to be inserted. On 

1050 consoles, the left-hand margin should be 
set at or 1 , and the tab settings should be 
at every fifteenth position (i.e., 0, lU, 
29... cr 1 , 15, 30 ...). 

(FULL) causes the conoand to operate on files in 
12-bit mode (e.g., • (MEMO) '-class files). 

Title: A line of information will be printed to 
prcvide file name, date, and time if and only 
if the printing is to begin with the first 
record of the file and TO or THRU is not 
specified. 

Break: An interrupt signal will stop the printing and 
terminate the command. The command terminates 
by calling 3HNC0M. 



(END) 



CTSS EP0GHAMHE3*S GUIDE Section AH.5-0U 6/69 1 



Pcint contents of a file in o:;tal 
PRBIN 

Pur£OS3 

Print on the user's console (or in a file for later disk 

alitor printing) the contents of a file in octal. It may be 

used to exanine SAVED or BSS files or BCD files which might 
contain illegal characters. 

D 3 a, 3.3 

PRBIM NAME1 NAME2 -Start- -•♦THRU"/"TO"/". • • " end- -nwords- 
-dalta- -blksize- -"OPF"/"OFFON"/"OliJOFF'»- -Daaie3- -nameU- 

start (optional) indicates the location of the first 
word in the file tc be printed. If it is not 
specified or is "♦", it is assumed to be "1". A 
starting location cf "0" will te turned into a 
" 1" . 

end (ofticnal but cnly when acaompanted by "THBU", 
"TC", or "...") specifies the last location to be 
printed. If onitted or "♦", the remainder of the 
file will be printed, 

nwords (optional) indicates the number of words to be 
printed in a block. These blocks are printed in 
groups 3f *n* words per line where • n' is either 
• nwords* or the number of words which can be typed 
on the consDle ("8" on a 27U1 or 1050, "5" on an 
ABDS, ^9" in the offline file, or "6" otherwise) 
whichever is the saaller. If omitted or "♦", 
•nwords* is assumed to be "5", "S", "8" or "9" 
depending upon which aonsola the user is at and 
whether or not he is creating an offline file. If 
• nwords* is used, the 'start* location must also 
be present. 

delta (optional) allows the "skipping" through the file 
printing every 'delta* words. If this argument is 
used both the 'start' location and 'n words' must 
be specified. If it is not present or is "♦", it 
is assumed to be "1". 

blksize (optional) is the nunber of words to be printed 
starting at every delta' th location in the file. 
It must net be greater than delta. If not 
specified or is "*", it is assumai to be "1", 

"3FF" (cpticnal) will append to a file 'natneS name4» the 
octal print of the file 'namal name2'. If "OFFON" 



CTSS EBCGEIAMKEH'5 GUIDE Section AH. 5. 04 6/69 2 



or "ONCfF" is used, the printing will also appear 
online. If 'nameB' is omittad, it is assumed to 
bs the saae as •naael*. If nameU is missing, it 
is assunied to be " BIN", 

" C" (cpticnal) may be used to indicate any of the 
above counts are specified in octal. It appears 
as a ss£arate argument preceeding the count 
(either ^start^J 'end', 'nwords* or 'delta'). If 
nissing the counts are assumed to be decimal. If 
the start iDcation is specified in octal using the 
"0" argument, the location printed at the 
beginning of each tlock will also be expressed in 
octal. 



(END) 



v_ioo rn>jvjnnnrjcjtv-i> oliLui^ oev^LX On Hti , j » \J j il/oj 



I^5£tif icat_icn 

Print suiriBary of BSS files. 
PRBSS 

P ur£ose 

To print a suaiiBary of information about the program in a BSS 
fila or about the programs if the file is a library file. 



Usaie 



PBBSS LIBE -ENTRY- 

FKBSS prints a summary of information about the 

prograrr(s) contained in file LIBE ESS. At 

least three lines are printed fcr each 
prcgra or: 

1st line: Entry names and their relative locations 
2nd line: Caramon break, program break, and 

transfer vector length 
3rd line: Subroutine names in transfer vector (if 

any). 

If LIBE is preceded by the parameter * (SQZ)*, 
a sunsaiary of the file LIBE SCZBSS will be 
printed. (See Section AJ,U.04 for a 

descriftion of SQZBSS files.) 

EUrsY (optional) specifies the program entry name at 
which printing should begin. If EKIfiY is 

omitted, printing begins with the first 

prcgraai in the file. 

BREAK A single interrupt signal will terminate the 
command by calling CHNCOM. 



(END) 






Print SAVED file 
SDUMF 

Pucpose 

To print the machine conditions and/or locations within a 
SAVED file. 



ysa^e 



Errors; 



SDUKP NABE1 

The machine conditions of file KAMEl SAVED will be 
printed on the user's console. 

SDUMP NAHE1 LOG -N- 

The contents of N consecutive locations (decisal) 
beginniny at octal location LOG, of the core ioage 
contained in file NAHEl SAVED will be printed on 
the user's console. All registers are typed in 
octal with mnemonics. 

I t will be typed to indicate that one or more 

lines cf all zero have been omitted. If N is not 
specified or is greater than 1000, 1000 locations 
will be dumped. Single break level is set to 
terminate printing and exit via CHNCOM, 



WAHEl SAVED HOT FOUSD. 

SAVED PILE HAS IMPBOPEB FOBMAT. 

LOCAriCN NOT IM SAVED FILE. 

File system diagnostics from 'fjaTEB' 



(EMD) 



t'lbS t^KUijMftnniJn ' b aulUo oeu lj-Qu nii.->.o/ 6/69 



J-dentiJicaticn 

Print an ASCII file 
P8IMTA 

Purgosa 

PBINTA will type the contents of an ASCII file. 

PR IN TA na me 1 na me 2 

PRINTA will type the file name in red, followed on the 
same line by the current date and time, then a 
blank line, followed by the file contents. 

Restrictions 

Linas longer than U80 characters will ba truncated. There 

is no provision far special action such as printing parts of 
lines or begirninij in the middle of the file. The only 
argumants to the command are the file*s names. 



(END) 



CrSS EHCGKAnnCK'a vjuj-i^c jcv-i.iw»i „ .. . -.- 



li a n ti f i ca t i o n 

Print a file as rapidly as pcssible 
P 

Purpose 

TO print the contents of a file, which a.ay be 6-bit 
linLarked or card-image or 12-bit Unemarked of^SCII. 
sequences of spacing characters are chosen to take the 
ItliL^ possible ti.e for the particular console being used. 

Usacje 

p NAME1 KAM£2 -options- 

If no options are specified, P -ill look at the first part 
ot the file to determine whether it is 6- or 12-bit or 
ASCII If the file i3 6-bit and linemarked and every line 
of the sa.ple begins .ith a valid carriage-control 
:;tiaracter, carriage CDntrol will be interpretei. Tabs 

the input file and at the console are assumed to be set 
3very 10 coluirns (11,21,...). An interrupt will cause P 
go to CHKCCM. 



m 



Options are: 



6: forces 6-bit aode 

9: forces ASCII mode 

12: forces 12-bit mode 

CC: forces interpreting carriage control 
NCC* forces not interpreting carriage control 
WB- if a line in the file is tco long for one 

output line, it will be continued on the next 
line. Normally the excess will be ignored. 
PS: two lines will be skipped at the beginning 
and end of each page 
HDB: a header giving file name, date and time, and 
page number will be printed at the top of 
each page; two lines will be skipped at the 
end of each page 
DATE- a header giving file name, date, and time 

will be printed at the top of the first page; 
two lines will be skipped at the beginning 
and end of each page 
HELP: a list of valid arguments to E will be 



I TAD 
OTAB 



printed 

tabs in the file are interpreted as set at 



every # columns 

tabs at the console are assumed set at every 

# cDlusnns 

LL #: the maximusn number of characters per output 
line is set to # 



CTSS PROGRAMHEK'S GUIDE Section AH. 5. 08 6/69 2 

PGL #: the number of lines per paga is set to # 
FILE nameU: an ASCII file called naaiel naneU is written 

instead of console output beinq produced 
Any of the above arguments may bs enclosed in parentheses 
BLKSIZ »: linemarks, if any, are ignored and a carriage 
return is inserted after every # words of 
input 
ITABS or OTABS list: incu*" '^r "UtDi»t +:»Kct , ^o. ~^^,,-~^ ±. - u- 

at the locations specified by 'list', 
•list' may be any combination of: 
#: a tab is set at colunn # 
CrSS: tabs are set at 15,30,45,... 
FAP: tabs are set at 8 ,16 ,35 ,40 ,U5 ,. . . 
MAE: tabs are set at 12,17,22,27,... 

Also, a colon in column 12 is taken to 
be a backspace 



(END) 



CTSS PKOGHAnriKK 'i> UUiUt Ejection Hn.o.ui raye 



I.denti£icaticn 

Combine files 
COMBIN 

PU££gS3 

The CDMBIN comniand ::oinbine£ several files of the same 
s^sondary name into a new file, also of the same secondary 
name. The format of the files is not significant. 



Usaje 



COMBIN S EQ NAME1 NAn£2 FILl...FILn 

COKBIN will combine files FILl through FILn of 
secondary name NAME2 into one file NAHEl NAHE2 
within the current file directory. If any FIL 
cannot be found, the NEED-USE convention will 
be follawed (see Section AH. 7. 01). Within the 
USE process, an ♦ for a corresponding FIL 
means that FIL should be ignored. The 
combining will not begin until all FIL's are 
accounted for. FIL*s ara not delated, 

SEQ is a decimal number of 1-U digits. The numeric 
sequence field begins with SEQ x 10 with 
leading zeros to complete the numeric field or 
with the most significant digits lost if SEQ x 
10 exceeds the numeric field width. Sequencing 
is done by incrementing the numeric field by 
10. If SEQ = »♦• or if MAWB2 is 'SAVED*, "ESS* 
or »CBIJNCH«, nc sequencing will take place. 

The sequence field (characters 73-80) may be 
composed of 2-5 numeric characters and 3-6 
alphabetic characters. The numeric field width 
is determined fcy a scan of the first line of 
FILl from right to left, beginning with 
character 78, looking for the first nonnumeric 
character (blanks are treated as numeric 
zeros) . The numeric field width and the 
alphabetic field width will remain fixed 
through the remainder of the command. The^ 
alphabetic information is obtained from each ^ 
line of the FIL*s. Note that the numeric field 
width will be at least 2 and not more than 5 
characters wide. * 



EXAMPLES: 



If characters 73-80 of the first line of FILl are 
ABC123GH and SEQ = 1, the new sequence for NAKEI 
MAME2 will begin with ABCOOO 10. 



CTSS PPCGRAMMER'5 GUIDE Section AH. 6. 01 Page 



If the first line contains Atbtbbbb and SEQ = 1, 
the new sequence will begin with AbbOOOIO. 

If the numetic field overflows, d massage will be 
printed, "SfigUENCE FIELD OVERFICW", and sequencing 
will continue from 0. 

Line-mar iced files composed of m-word lines may be 
sequenced. If a line of mora than or fewer than 14 
words is encountered, sequencing is stopfed and 
not resumed during execution of the rest of the 
command. A tnessage is printed, "SEQUENCING STOPPED 
AT xxxxx" . 



(END) 



UXbi) fKuGRflfinSK ' 3 GUIDE ScCtiOn AK. u. wt 



subdivide files 
SPLIT 

£ ur£osa 

The SPLIT coitBiand divides or splits a specified file into 
ona or more separate files of the same class. Either BCD or 
binary files may be SPLIT. 

Usacfe 

SPLIT NftMEl NAME2 MODE A1 SI A2 52 ... AN SN 

NAME1 NAME2 is the file to be SPLIT. In case HAME1 
NAME2 cannot be found, the NEED- USE convention 
if followed as in the LCAD command (Section 
AH. 7.0 1). 

Ai are the new files to be created, with the 

secondary name NAME2- All previous copies of 

new files are deleted, if possible. Any Ai may 

be replaced by •♦♦'• if the file delimited by 

S(i-1) and Si is not wanted. Any Ai may be 

NAMEl. As the original file will not be 
deleted until all splitting is completed. 

Si are the numerical dividers of the file in 
order of appearance as the file is scanned 
only once and are interpreted, depending on 
the mode, as line number, record number, or 
number of hords. The Si (th) record (or words) 
belongs to file Ai unless Si falls between 2 
sequence numbers, in which case the file is 
split between them. 



e. g. If Nj .LE. Si , L, Nd + U where N 
sequence number in NAflEI. 



IS 



then file Ai ends with Nj and file A(i+1) 
begins with N(j*1) 

Sn may be omitted if An is to go through the end^ 
of NAME1. 

MODE: 

There are three kinds of files which may be SPLIT: 

1) Line-numbered - BCD card images (14 words) 
■with numeric sequence number in column 76-80. 



CTSS FPCGRAMMER«3 GUTCE Section AH. 6.02 Page 2 



2) Line-marked or variable length records 
preceded by an extra word which contains the 
word count of the record. 

3) String - no obvious record divisions. 
Records may be treated as 1t» word records or 
by external word count. 

MODE is an optional argument which may be inserted en either 
side of hAMHI NAME2. 

Hecori number node assumes ^^ word records, unless they are 
line-marked, and numbers them sequentially starting with 1. 
This mode may be requested by the MODE argunent (RCNG). 

Word count mode splits strictly by a count of the words, 
including any line marks present. This mode may be requested 
by tha MCDE argument (WCCr). 

It no mode is specified, it is assumed to be line numbered. 

If, at any time, a record is encountered which does not 
appear to be a regular BCD card image (e.g. not 1U words 
long or non-nuroeric in columns 76-80) a change is attempted. 
IE search is still being made for Si (no splitting has taken 
place) , the mode is changed to record number, if possible 
and tha saarch continues. Otherwise, splitting is stopped, 
the rest of NAME1 is placed in a temporary file, and an 
appropriate comment is made. No other changes of mode can 
occur. 



(END) 



'^nrm? <Zaf-i-inn AH-ft.ai 12/fiQ 



Identification 

Changa tha mode oc the name or delete a file 
CHMODE, RENAME, DELEIE 

PurEose 

Cofflmands to change the mode or the name of a file or to 
ialats a file. 

Usaia 

Dalata ; 

DELEIE NAHEI NAME2 NAMEIn NA11E2n 

DELETE calls the file system entry DELFIL to delete 
file NAMEIi NAME2i from the current file 
directory. If for any reason a tile cannot be 
deleted, a message is printed: 

NAMEIi NAME2i NOT DELETED 



NABEIi is the primary name of a file to be deleted. 
If HAMEIi is *, all files of secondary name 
NAHE2i will be deleted. If NAKE2 is also ♦, 
no files will be deleted and the message " ♦ ♦ 
NOT POIND" will be printed. If the name 

contains imbedded *'s, the "LISTF ♦ 

convention" will ba used. That is, the ♦ will 
match any character including blank. 

NA«E2i is the secondary name of a file to be deleted. 
If MAMB2i is *, all files of primary name 
8A«E1i will be deleted. If the name contains 
imbedded **s, the "LISTF * couvention" will be 
used . 

Changa mode: 

CHRCDE NAHE1 NAME2 MODEl ... NAMEIn NAWE2n MODEn 

nodes may be expressed in combinations of octal or 
alphabetic mode designations (see below) and the 
special characters * (taken to te the present mode 
of the file) and "/" (to mean "remove the 
follawing m3de bits" from the nicie being created). 
An initial •'/ " implies a preceding *. 



CTSS FPCGRAMMER'S GUIDE Section AH. 6. 03 12/69 



letter octal meaning 

permanent 

1 1 temporary 

b 2 ceaoved ("secondary") 

B 4 read-only 

W 10 write-only 

V 2 private 

L UQ reserved for system use 

p 100 protected 

M 200 "being restored from tape" 

Up to six of the letters or octal numbers can be 
concatenated to form combination modes; for 
example : 

PB = 10U protected/read-only 

*V add private to previous mode 

UP20 = 124 pLotected/private/read-only 

/X = ♦/ 1 remove temporary mode bit 

NAMEIi NAME2i - The same ♦ conventions are used as in the 
DELETE command. 

Rsnama : 

BP.NAME NAMEl NAME2 N AM E3 NABEU MAHEIn liA!lE2n SAHESn BAMEUn 

RENAME changes the file name HAHE1 SAME2 to the name 
NAME3 NAttEU by calling the supervisor entry 
CHFILE. All other files NAKE3 HAMEU will be 
delated before renaming 8AWE1 NAME2. The 
deleting of NARE3 NAHE4 has the same options 
and messages as DELETE. If NAHE3 NAMEU cannot 
be deleted, no names are changed. If the file 
canoat be renamed, a message is printed: 

FILE NAMEIi NAME2i SOT RESAMEC 

NAMEIi NAME2i - The same * conventions are used as in 
the DELErE command. 

NAM£3i NAME4i - If either SAME3i or NAME4i contain 
imbedded *'s, the ♦•s will ba replaced by the 
appropiate character from MAHEIi and NAWE2i. 
If NAME4i is missing, it is assumed to be 
NAME2i. 



(END) 



C/aol- ^ nn &H A C\tX ft / A <=; 



ligntif ication 

Common files 
COMfIL, COPY, UEEAIE 

Purpose 

A group of "comaion" file directories (surrantly up to five 
in numbar) is frequently assigned to prograraoers working on 
the same problem number. ("Comfflon" is used in the sense of 
"aacsssible to all".) The COHFIL command allows the user to 
cause the currently atacbed to file directory to be one of 
th3 common file directories or to switch back to his own. 
The UPDATE coniinand allows the user to transfer a file from 
th3 current file directory into one of the conacn file 
directories. The COPY ccmmand allows the user to copy a 
fila from a common file directory into his current file 
directory. 

MetJ^od 

Both COPY and UPDATE create intermediate files whose names 
are a function of the current time of day. This method of 
ganaratinj unique iiames allows several users to be working 
in the same file directory without adverse interaction with 

each other , 

If COPY or UPDATE is used to move OUTPUT fiCUEST files, the 
rasulting file will be an appended file rather than a 
replaced- by- deletion file, as is the standard procedure. If 
there is a temporary version of OUTPUT 83UEST in the 
receiving directory, it will be deleted before the COPY or 
UPDATE is performed. 

Naithar COPY nor UPDATE resets the current tile directory 
switch, i.e., ufcn ccmpletion of the conmand the current 
file directory is the same as it was at the beginning of the 
command. 

Usa^e 

Comf il: 

COMFIL -N- 

N specifies the file directory desired as 0, 1, 
2, 3, 4, 5. signifies the user's file 
directory. If N is omitted, it is assumed 
zero. 

C3MFIL switches the current file directory to N so 
that all subseguent commands will refer to 
directory N. Unlike the old file system, 
active files are now not reset when a 



CISS PaOGHAMMER'S SUIDE Saation AH. 6.04 8/65 2 

directcty switch occurs. 

Copy: 

COPY N NJiMEl NAME2....NAME1n SftME2n 

COEY tcansfecs files NAME1 lIAME2n from coninion 

file directory H into the current file 
diractocy. Any files of the sane name in the 
current directorj will te deleted by the 
DELETE ccnventions after ttie successful 
copying of the new files. Files keep the same 
names but are always created in permanent 
mode. 

N tnay be 0, 1, 2, 3, U, 5, S or P. S and P are 
synonynious and allow copying from the public 
or system file directory. 



Update; 



UFCAIE N N&HEI N AN E2. . . .M AH E In NAMB2n 

N is the user's common file number 0, 1, 2, 3, 
a, or 5. 

UPDATE transfers files BAME1 . . . NABE2n from the 

current directory to the specified common 
file. Files keep their same naie and mode. 
All previous versions in the receiving file 
directory are deleted by the DELETE 

conventions only after successful updating. 
The files in the current directory are 
unchanged . 



(END) 






lixfltifi cation 

Library file 
EXTBSS, UPDBSS 

PucEOSe 

A library file oay be created by combining proyrams in BSS 
form. The progran loaders can search this kind of file to 
find missing programs. The hcusekaeping of these files can 
b9 iona by JJXTBSS and UPEBSS. 

Usa^e 

Extract: 

EXTBSS LIEE FILEI ENTRY 1 FILEn EMTBYn 

EXTBSS will extract from the library file LIBE BSS 
the first BSS routines with the entries ENTRY 1 

... ENIRYn and create files FILE1 FILEn 

BSS. Older files of FILEi BSS ara deleted, if 
possible. LIBE BSS is unchanged. 

ENTRYi If an INTRYi has the same name as FILEi, •=• 
may be used in place of ENTHYi . ESTRYn (the 
last parameter on the line) may be omitted if 
it is identical to FILEn. If ENTRYi is 

• (MAIN) • , the first main program will be 
extracted from LIBE BSS. 

FILEi If FILEi is preceded by the parameter '(SOZ)', 
the extracted file will be created in sqzbss 
format (See section AJ.U.OU). In this case, 
the naite of the file will be FILEi syZBSS. If 
the parameter • (SQZ)* precedes LIBE, 

extraction will take place from the file LIBE 
SQZBSS. 



CTSS EBCGRABaER»5 GUIDE Section AH. 6. 05 11/65 2 

Update: 

UPDBSS LIBE FILE1 ENIBil FILEn ENTRYn 

UPDBSS searches the library file LIBE BSS for the 
first BSS routines with entries ENTBYI ... 
ESTRYn and replaces each routine with the 
correspondiny file FILEi BSS. This is 
accaiaplished by creating a new file LIBE BSS 
and deleting the old, if possible. If LIBE 

BSS can not be deleted, no updating is 
accomplished. If an BSTRYi is not found in 
LIEE, UPDBSS will print the following aessage: 
"EMraYi NOT FOUND. DC YOU WISH TO APPEND IT," 
If the response is "YES", FILEi will be 
appended to LIE£. 

ENTRYi The same conventions in EXTBSS with regard to 
the use of •=' and omission of the last 
parameter, EMTHYn, apply also to UPDBSS. If 

FILEi is '*•, the first routine with entry 
name ENPRYi will be deleted from LIBE BSS. 

FILEi If any FiLIi is preceded by « (SQZ)' , the file 
FILEi saZBSS will be inserted. Preceding LIBE 
by MSQZ)« will cause IIBE SQZBSS to be 
updated. 

If any FILEi cannot be found, the message 
••FILEi BSS NOT FOUND." will be printed, and 
UPDBSS will exit to DORHNT. The user nay then 
type »DSE NEHFLi" to use a different FILEi, 
"USE *" to delete the entry from LIBE, or 
"START" to ignore the update of EMTRYi . 



(END) 






Off-line processing 
RQUEST 

Pur22§§. 

Requests may be submitted to the dispatcher to print or 
punch current files, ot send a current file to the other 
machine (HAC or Center) for reloading and updating. These 

rsguasts may be submitted as punched control cards (see 
Section AE. 1) or via the HQU EST command from the console, 
which will prepare a file called OUTPUT BCOEST in the user's 
iirsctory. The control cards and the OUTPUT RQUEST files 
ace processed several tiroes a day by a background job called 
the disk editor. 

Usa^e 

R2UEST XX »AME1 NAHE2 -0P-. . . NAKEIn NAME2n -CPn- 

XX=«PKINT«: The BCD file BAME1 IIAME2 is printed off-line. 
If the file is not line marked, a blank word 
is insetted at the beginning of the line to 
insure single spacing and the first 84 
characters of the record are printed. If the 
file is line-marked, the first character is 
the carriage control character and the next 
131 characters are printed. 

If the file is line-marked and the secondary 
name is FAP or BAD, the file will be 
effectively XPANDed to 80 columns for printing 
with tabs replaced by the appropriate number 
of blanks and null characters deleted. A 

blank word will be inserted in front cf each 
line to insure single spacing. Sequence 

numbers will be inserted in columns 75-80. 
The file itself remains unchanged. If the 

secondary name is other than FAP or MAD, the 
file will fce XPASDed to 132 characters by 
inserting sufficient blanks so that tab stops 
come out at positions 11, 21, 31, (+1C) ...» 
120. Also, if the secondary name is ALGOL, 
LISP, or LSPOUT, a blank character will be 
inserted in front of each line to insure 
single spacing. However, an ALGOL file will 
be XPAWDed to 132 characters by interpreting 
tabs for columns 11, 16, (+5) ..-, 6b. 

XX = 'SSPRNT': The BCD file NAMEl NAI!E2 will be printed with 
a leading blank on each line to insure single 
space printing. Line numbered files are 

always printed single spaced. 



CTSS PROGRAMMER'S 3UIDE Sa^tion AH. 6. 06 12/69 



XX = 'DPUNCH': The BZD tile NAME 1 NABE2 is punched off-line. 
If the file is line-marked, just the first 80 
characters per line of data will be punched. 
Line-marked files will be XPANDed in the same 
way as described under PRIHT. 

XX='BPUNCH': The binary card image file NAMEl MAflE2 will be 
punched off-line. The 7-9 punch and checksums 
should already be included in the card image 
file. 

XX=«7PUHCH': The file NAMEl HAME2 (of anj format) will be 
punched aff-line in a special card format 
which may be reloaded by the disk editor to 
reproduce the file exactly. The file is not 
deleted from the user's directory. 

XX='DELETE': The file NAMEl NAME2 will be deleted from the 

current file directory. PBIVATE or PBOTECIED 

files may not te deleted. Deletion will not 
occur "through a link". 

XX='PLOr': The file NAMEl NAME2 will te placed on the 

plot output tape for plotting on the CalComp 
plotter, (see APM- 1) 

XX='PRND£L', 'SSPREL', 'EPUDEL', 'BPUDEL', 'TPUDEL', 

•PLODEL': 

The file(s) will be ERINTad, SSPHNTed, 
DPUNCHed, EPUNCHed, 7PUMCHed, or PLOTted and 
then the mode will be changed to temporary. 
PRIVATE or PROTECTED files will not be changed 
to temporary, nor will files be changed 
"through a link". The next time the file is 
read or the user logs out, the file will be 
deleted. Note that any other reguest for the 
same file following a "DEL" request will cause 
the tile tc be deleted. 

OP refers to the options available for the CARRY 
request . 



Mathod 

The 8QUEST ccinmand creates or appends to a file in the 
usac's file directory called OUTPUT ROUEST. This file 

contains control card images which will be processed by the 
disk aditor program. If either of the naites contains a "*", 
the RQUEST coimand will search the file directory for all 
fila names corresponding to the requested name according to 
the LISTF "* " conventions. Warning: words 13 and 1U of 



yjiixiJMi ot^CcXuii Hn«u.uu <£/u7 



aa^h ~ara imaye ace used for the reguestiny user 
identif icaticn. If ED is used to modify the OUTPUT RQUEST 
file, these identifying words are destroyed. After 
procrassing, the disk editor program will change the node of 
OUTPUT RQUEST to temporary. This change to temporary allows 
tha oparations staff to rerun the disk editor if any 
difficulty was encountered in the first run. Note that 
OUTPUT RQUEST contains only the control cards which point to 
the actual files to be processed. The disk editor program, 
upon processing the request files, will generate three 
iiffaraat tapes: printer, punch, and carry. These tapes are 
then the responsibility cf tha operations staff. 



(END) 






liS.ilti£ication 

Sanaral file system call 
CALL 

Purpose 

CALL provides a single unprivileged comaand which may be 
used to call any one of various I/O system entries 
(subroutines) from command level, 

CALL ENTRY ARG1 ABG2 ABGn 

ENTRY may be any of the file system entries. Note 

that privileged calls may be made only by 
users with appropriate privileges. 

If tape labels cannot be specified in BCD as 
expected by VERIFY and LABEL, they may be 
specified in octal by 

CALLing BVERFY or BLABEL. 

ARGs are the arguments required ty ENTRY. 

Optional arguments may be specified as *. 
Trailing optional arguments may sinply be 
omitted . 

Ras2ons3S 

The ENTRY lODlAG will furnish the same information that the 
subroutine dees, on one line. (See AG.4.06) 

Summary of Possible Dggs of_Call_ 

1. CALL UPDMPD PROB PROG 

2, CALL DILMFE PROB PROG 

3. CALL ATTACH PROB PROG 

U. CALL MOVFIL Nl N2 PROB PROG 

5- CALL SEIFIL Si N2 MMCDYY HHMM MMDDYY AUTHNO -MODE- 

-DEV- 

6. CALL LINK HI N2 PRCB PROS -Pi- -F2- -MODE- 

7. CALL ALLOT DEVICR -ALLOTTED- -USED- 

8. CALL UPDATE 



CTSS PROGRAMMER'b GUIDE Section AH. 6. 07 9/66 2 

9. CALL OPEN STATUS Nl N2 -nCDE- -DEVICE- 

10. CALL BUFFER Nl N2 -LEN3TH- 

a. Only one active fila can be buffered at any 
one tiae. 

b. If •LENGTH* is not given, it is set tc zero. 

11. CALL RCFILE Nl N2 -RELLOC- -CCUIiT- 

a. If •COUNI* is not given, it is set tc 1. 

b. 'COUNT' .LE.20; if 'COUNT' .G.20, then it is 
taken as 20. 

c. If 'BELLOC is not given, it is taken as 0. 

d. 'COUNI' words are printed out. If the EOF is 
reached or passed, the word 'EOF' precedes 
the output. 

12. CALL RDMAII Nl N2 -RELLOC- -CCUM- 
a. See remarks a-d Item 11. 

13. CALL WBFILE Nl N2 -RELIOC- -CCTIH- -OCTRH- 

a. 'OCILH' and 'OCIRH' are converted to octal 
and treated as one word. Default value for 
'OCILH' and 'OCTRH' is 0. 

b. Default value for 'REILCC is 0. 

c. If 'RELLOC' lies beyond the end of file, the 
word 'EOF' is printed and no writing is done. 

14. CALL WRWAII Nl N2 -RELLOC- -CCTIH- -OCTRH- 
a. See remarks a-c Item 13. 

15. CALL IRFILE Nl N2 -HELLOC- 

a. Default value tor •REILCC is 0. 

b. If this is the first usage of the 'CALL* 
comioand, the following lines are generated. 

OPEN. ($W$,N 1,N2) 

EOJFER. (N1,N2, BUFF(«32) ...432) 

TRFILE. (N1,M2, RELLOC) 

CLOSE. (Nl ,N2) 

Otherwise, the standard call to •TRFILE^ is 
gener ated . 

16. ^ C-ALL -FGHLCK Nl N2 






a. If the I/O is aompleted for 'Nl N2 • , the word 
•FINISH* i3 printed, otherwise nothing is 
printed . 

17. CALL CLOSE Nl N2 (cr CALL CLCSE ALL) 

IB, CALL FWAII Ml N2 

19. CALL SETPRI -PSIOR- 

20. CALL HESEIF 

21. CALL CHFILE Nl N2 -MODE- -NEHN1- -NEWN2- 

22. CALL DELFIL Nl N2 
2 3. CALL ESTATE Nl N2 

a. Resjionse is: LENGTH MODE STATUS DEVICE 

NEXT-HEAD NEXT-WRITE 
DLH TLM DLU AUTHND 

b. If file is a link, • HCDE« will appear as 'L' 
MMM. 

2a. CALL UNLINK Nl N2 

25. CALL ST0R3E DEVICE 

a. Response is: ALLOTTED USED 

26. CALL ATINAM 

a. Response is: ATTACHED-PROB ATTACHED-PROG 

AUTBMO PHIOBITY 

27. CALL lODIAG 



28. CALL EXIT 

a. Returns via a sail to CHMCCtt. If any file 

was opened during this usage of »CALL», EXIT 

will leave core image, otherwise, no core 
image is left. 

Special ArquBents to 'CALL* 

1. (GO) - Inclusion of this argument anywhere in a 

call ccmiBand line hill cause the command to type 
the word 'CALL* and then wait for further file 
call instead of exiting after processing the 
indicated call- Sample uses of this argument 
might be : 



CTSS ESCGBAtSMtH'S GUIDE Section AH. 6.07 9/66 



CALL 


OPEN R A 


B 


(GO) 


^Akk 


RDWAIT A 


B 


1 5 


calI 


CLOSE ALL 






CALL 


EXIT 







2. (FNS) - laclusion cf this argument indicates to 
•CALL* that a fence (Octal llllllllllllYi) is tc be 
placed in this position and that scanning of the 
comtnand line is to continue. 

3. * - This argument specifies that an optional 
t-aratneter has not been supplied- 'CALL' will pass 
a null parameter to the file system, 

4. (ijTAH) - Inclusion of this argument indicates that 
an asterisk is tc be placed in this position and 
scanning of the command line is to continue Mote 
that this is not equivalent to the special 
argument, ' ♦'. 



(END) 



^.T.^^/< nn^^nk.><HC<aio r!tiTr»P Qor-i-inn AH. 6. 08 6/69 1 

v^ioo irn«jv3EiiiHui»u .J ^«^ww — — 

Ideatif icaticn 

Attach to another usee's file directory 
ATTACH 

Purgose 

To allow a user tc attach to another user's file 
airactory for the purpose of examining and/or modifying his 

fil2S. 



Usa^e 



ATTACH Prob Prog 



IE th3 command user is explicitly permitted to LINK to the 
file "U.F.D. (FILE)" in the directory "prob prog" in mode 0, 
ATTACH will change the command user's working directory to 
be "prob prcg". 

If "prob prcg" are onitted, ATTACH will reattach the user to 
his home file directory. A user may also return to his home 
iirsctory by using the COMFIL command, or by executing a 
program which calls COMFIL. 

If a user's frograro -alls TSSFI L (sas AG. 3.03), the 
supervisor will save the name of his current attached 
directory, and will restore it when USBFIL is called. 

To give another user permission to attach to your directory, 
typ^ "PERMIT U.F.D. (FILE) probn progn", where "probn" and 
"progn" identify the user or set of users to whom ycu wish 
to give permission. Note that you must nama "U.F.D. (FILE)" 
axplicitly: "* *" will not do. 



(END) 



CO re Rft MMP Dt:; nriTrF Section AH-6.09 12/69 1 



I d e n t i f i ca t i c n 

Appand files 
APEND 

Pur22§^ 

To allow files tc be coiatined together; to allow new files 
to be appended tc existing files; to allow files to be 
-ombinsd into a crss tape file without creating an 
intermediate disk file. 

Usaie 

APEND N1 N2 f 1 f 2 f 3 f U ... 
Files • t1 f2', ' f 3 f4«, etc. are appended to file 'Nl N2»- 

APEND N1 N2 •♦' f1 f2 f3 ... 

Files 'fl N2', •f2 N2«, •f3 N2», etc. are appended to file 
•N 1 N2*. 

Method 

File 'Ml N2' is initially opened for writing. Each file to 
b3 appended is then in turn opened, copied onto the end of 
•Nl N2', and closed. In the event of any fila errors, all 
files are closed and a diagnostic is printed. Note that if a 
f il3-not-f ound error is received while in the middle of a 
long series cf append operations, all previously appended 
fil3s will have been processed properly, and the operation 
can be continued later. 



(HMD) 






Identification 

Off-line ASCII printing 
RQASCI 

Pur£OS3 

Allow the user tc request printing of ASCII character streaa 
filas with the ASCII chain on the Center's specially 
modified 1U01. 

Usa_ge 

BQASCI NAME1 NAME2 NAME3 HAME4 ... 

Ths filas •NAMEl NAME2', "NAMEJ NAME4', etc. will be printed 
during the next run cf the ASCII editor. Currently, the 
ASCII editor is run twice daily, at OUOO and 2200. 

If NAnE2 of a file to be printed is BUNOFF (See AH. 9. 1, 
AH. 9. 06: 'print* option on BUNOFF and ROFF aoamands) , the 
fiia'is printed exactly at it appears. If NAME2 is not 
RUN3FF, foriB-feed characters (ASCII 01U) are inserted at the 
bottom of each page, to skip over the perforations on the 
paper. 

Method 

R3ASCI writes (through a link) into the file ASCII RQUEST 
maintained in the directory «iai6 2962. This file is read by 
th3 ASCII editor. Ihe file is in private mode, and is 
accessible only via the RQASCI command. The link made to 
ASCII RQUEST is left in the current file directory. 

R 2 s t r i c t i on s 

A request made with RQASCI cannot be deleted, as is possible 
with the standard disk editor and RQUEST commands. 



(END) 



^«^^ n.,n^r> ■> lau Cio I C7 ll'.TtM? Qoffion AH. 7. 1 5/66 1 



Identif icaticn 

Ralocatable program loading 

L3AD, LOADGO, VLOAD, NCLO&D , L, USE 

There are five different types of loading available for 
relocatable programs i.e., BSS files. The first (LOAE) «ill 
load a program into core without destroying the loader or 
MOVIE) table, place the program in dormant status and 

r-turn to the user foe the next command. The second (LOADED) 
is the result of the chain of commands ICAD anl STAFT. The 
third (VLOAD) will load the program; move all of the Program 
and COMMON down in core to destroy the loader and MOVIE) 
tibia (thereby making the available core larger); place the 
program in dormant status and return to the user fo^ the 
n^xt command. The fourth (MCLOAD) is the same as VLOAD 
except that erasable COHHON is also destroyed so that no 
library routines which use erasable COWHCli may be used. The 
fifth (L) is a separate command which allows any one of the 
previously mentioned four to be used with larger loading 
tables (see Bestrictions) . 

Programs or files may be loaded (or searched as library 
files) from the user's file directory, from his common files 
ana from several system files. 

IE ne-led routines cannot be found by the loader, the USE 
command may be used to specify which routines may be used 
instead. 

Restrictions 

Normal maximum table sizes are: MOVIE) table is 500 words 
and the table of missing entries is 100, 

The tables for the L coaaand are: MOVIE) table of 1200 words 
and missing entries of 250 words. 

Whan several programs are loaded, the one using the most 
common should be loaded first. 

Usa_ge 

Any of the load commands (LOAD, LOADGO, VLOAD, SCLOAD) may 
b*- used in place of LOAD; all special arguments are optional 
and order is significant by meaning or where specified, 
special arguments are those beginning and ending with 
paranthasas as shown. They cause the loader to behave in a 
spacial manner. The non-special arguments are either file 
names or entry points, depending upon the preceding special 
arg uman ts. 



CTSS PHOGRAMMER'S GUIDE Section AH. 7. 01 5/66 2 

Dpon coanpleticn cf leading, the current file directory is 
switched to its initial status, 

LOAD (CRG) (CfLn) (LIBE) (SYS) (SEED) (SLIB) NAMES (HOSE) 

(CHG) The presence of (ORG) instructs the loader to 
set the starting address to the entry naae 
specified ty the next non-special argument 
following (ORG). 

(CCNT) as the first argument, may be used for 
programs calling the loader through the 
comaand buffers in order to retain control in 
the event of a loading error. The next 

non-special argument is the name of the file 
which should be resumed in case of an error. 

e.g., SAVE X 

LOAD (CONT) X A B ... 

SAVE Y 
RESUME X 

After this sequence, X can determine 
whether or not the load was successful 
by the existence of Y SAVED. 

(NEED) The presence of (NEED) instructs the loader to 
treat the next non-special argument as a 
progran entry point as though it had been an 
entry in a transfer vector. 

(MORE) may be the last argument before the carriage 
return (because only one line can be 
interpreted by the command) to indicate that 
more arguments will be specified. In this 

case the leader will not print the NEEE list; 
will restore the common file switching to the 
initial setting; and return to the user (by 
way 3f CHNCOM) so that the USE command may be 
used. 

(CFLn) directs the loader to switch the current file 
directory to common file directory n which may 
be 0, 1, 2, 3, 4, or P. The current file 
directory is initially the user's file 
directory or a directory set by a COWFIL 
command. There may be any number of these 
switches in the argument list and each one 
supercedes the previous one. 

(LIBE) directs the loader to use the next non-special 
argument as a file within the current file 
directory to be searched as a library file to 



- - ... ^..-r^w, <^^— <.i~^ %a 1 f\^ t^/f,f. 



find any missiny routines. 

(SYS) directs the loader to use the fcllowing 
non-special argument as a file from the system 
file directory to be searched as a library for 
any missing routines. 

(Nllfi) directs the loader not to search the system 
library (i.e., TSLIBI ) for missing routines 
after the argument list has been processed. 

(IIB) supercedes (NLIB). 

NAMES may be the primary names of BSS files to be 
loaded or BSS files to be searched as 
libraries following certain special arguments 
or NAHES may be routine entry points as 
required by other special arguments. 

NEED Following the processing of the argument list, 
the system library TSLIBI will be searched for 
any missing routines (unless prohibited by 

(NLIB) ). If routines are still missing, the 
current file directory is switched to the 
user's directory, a list of needed routines 

(by entry names) is typad by the loader and 
DOBH»r is called so that the user may type the 
USB coamand. Upon completion of loading, the 
current file directory is switched to its 

initial status. 

USE will reinstate the last coamon file switching 
and go back to the loader. All of the 

arguments available to the loader are 
therefore available to USE, 

LOAD sets the origin of the first program at 
(5200)8. rhe MOVIE) table and the loader are 
left inviolate below this origin. COHMON 

addresses are relocated with the same parity 
as on the assembly listing. FAP coded 

subpragrams, which contain the EVEB pseudo op, 
will be loaded with relative location in an 
even cere location. Upon completion, all 

loaders call CBMCOM with an available core 
image specified. 



LOADGO is equivalent to the sequence of commands 
and START. 



LOAD 



VLOAD After the entire program and library 

subroutines have been LOADed the program is 
moved down so that the origin is (30)8, 

covaring the loader and the MDVIE) table- The 



CTiJS PROGRAMMER'S S UIDE Saction AH. 7. 01 5/66 



(316) d words of erasabla CCPMCK are included 

with the program. The MOVIE) table will be 

preserved if MOVIE) occurs in the transfer 
vector of any routine loaded. 

NCLOAD is the same as VLOAD except that the (316)8 
words of erasable COMMON are not included and, 
therefore, if library subroutines which use 
erasable common are included, a COMMOM 
assignment error message will be printed. 

L The L command may be used if larger loading 
tables are needed (see Restrictions) . The L 
precedes any one of the LOAD commands as: L 
LOAD ABGUMENTS. If the loader name is 

omitted, it is assumed to be LOAD. All of the 
regular loader arguments are available. The 

program loading by LOAD starts at (7000)8 
instead of (5200)8, There may be more than 
250 missing entry names if this does net occur 
during a library search. L always calls 
CHSCOM, regardless of the outcome of the 
loading. Nc core image is kept if loading 
failed. 

MOVIE) table is created by the loader to provide a 
storage map of all entry points of routines as 
they are loaded. It is always written as a 
file (MOVIE TABLE) in the user's directory in 
temporary mode. If the entry MCVIE) appears in 
the transfer vector of any routine loaded, by 
VLOAD or NCLOAD, the MCVIE) table will be 
preserved by moving it to the top of the load. 
The MOVIE) entry points to location (27)8 
which contains the MOVIE keyword which 

contains the number of words in the movie 
table in the decrement and the location of the 
lowest word in the movie tatle in the address. 
The format of the MOVIE) table, starting with 
the lowest location, is: 

1. fence 

2. Lowest common break (address) 

3. SVN prefix 

U. Memory bound (address) 

5. ECB entry name 

6. Entry point for previous name 

(address) 
Pairs of words 5 and 6 for each 
entry to the subprogram. 

7. SVN prefix or P2E 0,,n, where there 
are n words in the transfer vector 
of this subprogram. 



CTSS PHOGaAHHER'S GUIDE iiaction AH . / . u i d/do 



8. Origin of this subprogram (address) 
Repeat groups 5 thru 8 for each 
subprogram loaded. 



CTSS EFCGRAMMER'3 GU ICIi 



Section AH, 7. 01 



5/66 6 



l#\y«-rU(^ XOal 



CgRE_MAP 
(All numters octal) 



0-7 
10-23 
2U-26 
27 



ZERO 

BOOISTRAP for NCLOAD and VICAD or TSX LCAD,4 
ISX (ORG), 4 for MCLOAD and VLOAD or TSX LOAD,U 
MOVIE) Keyword 





LOAD, LOADGO 


VLOAD 


NCLOAD 


30 


LOADER 


ERASABLE 
COMMON 

3U6 


PROGRAM 
COMMON 






PROGRAM 
COMMON 




U661 






PROGRAM 


PROGRAM 




EEASAELE 
COMMON 


5200 




nB2 


MB3 




PROGRAM 

COMMON 




PROGRAM 








Md 1 









M3mory Bounds: 



MB3= 30 + 77U61 
Mb2 = 316 + Ma3 
MB1 = 1632 + MB2 



COMMON BREAK + PROGRAM LENGTH 



(END) 






Absolute PrcgraiB loading 
LDABS 

Purpose 

To load a program from a file containing absolute column 
binary card images. A SAVED file may be created directly by 
LDABS, if desired. 

Wa rninci 

Unlike the ether loaders, LDABS will create the SAVED file 
rapresenting the pcagraia it has loaded in seven-tag mode. 



Usaie 



LDABS AMAME -SNAME- 

ANAME is the primary name of the file ANftME • ABS ' 
which contains absolute ccluien binary card 
images with full word checksum. 

SNAME is the primary name of SNAME SAVED which is 

(optionally) to be the SAVED fila created by 

LDABS. Previous versions of SNAME SAVED are 
deleted using the DELETE conventions. 

LDABS will lead a program into core with an upper 
limit of (77777)8 and a lower limit of 0- The 
meaory bound is set, upon completion of the 
load, to the highest location loaded. Loading 
terminates with a transfer card and execution 
may be started at the transfer-location by 
issuing the SI ART command. 



Error Conditions: 
a) 



If a check sum error occurs, the comment: 
CHECK SiJB ERBOH IN CARD XXXXX is pointed, 
where XXXXX is the location in which the first 
word on the card is to be stored. After this 
coKaent is printed the card is ignored and 
loading continues. 

b) If an attempt is made to store in a location 
greater than (77777)8, the comment: CARD 
IXIfIX OUT OF BCUSD is printed, the card is 
ignored, and loading continues. 

c) If a transfer card is missing, i.e., an end of 
file is reached, the comment: TRANSFER CA8D 
MISSING, TYPE CCTAL STARTIBG LCC, is printed- 



CTSS PROGB&MMEa'S GIJIDE Section flH-7.02 5/66 2 



The characters typed are convertad to an octal 
location and the transfer location for 
starting is set up. 

d) Any card with other than a 7- 9 punch in column 
1 or a word count .3E. 23 will result in the 
message: CAHD YYYYY ILLEGAL BINARY CARD. The 
card is then ignored and loading continues. 



(END) 



r-TQC Dunrzo A MMWo * c: nitrnp ca-^i-ir^ri ah ^ ni 



13 an tifi cation 

Start or continue execution 

START, BSTABT, RESTOB, BECALL, RESUME, R, CCKTIH 

Pur£ose 

Programs may have their execution interrupted (e.g., through 
use of the -juit button or call to DOBMNT) or delayed (e.g., 
LOAD as opposed to L0AD30, or the sequence LCAD, SAVE) , The 
::offlmanas covered in this section give the ability to cause 
the execution of such programs. 



Usa^e 



START -ARGl ARG2 ... ARGn- 
RSIART 



The START coitmand may be used to begin a program which has 
baen loaded by one of the LOAD commands, or it may be used 
to continue a dormant program from the place of the last 
interruption. The BBGi represent optional arguments, which 
will be placed in the command buffers; this technique is 
useful for programs which call DORMNT in anticipation of 
another "pass". 

RSTABT is equivalant to START, except that it is transparent 
to (i.e., does net alter) the current command buffer and 
::offlmand location counter. It should be used when restarting 
a chain of conmands. 

fiESTOR NAMEl 
RECALL NANEI 

Tha BESTCR and RECALL connands will restore the core image 
from NAME! SAVED complete with active files, if any. The 

pro-jram is placed in dormant status so that it may be 
(K)STARTed in order to continue from its last interruption. 

In addition, RECALL restores the command list and common 

file switching from NAfiEl SAVED, and preserves the command 

location counter and current command buffer in case of a 
subsequent RSTART. 

RBSUHE SAHEl -ARGl AEG2 ... ARGn- 

(HESUME nay be abbreviated by the letter R.) The RESUME 

command is effectively the same as RESTCR and START. The 

arguments are placed in the current command buffer so that 
it contains NAMEl AR31 ARG2 ... ABGn. This is a technique 
for writing and checking out a new command. 

CONTIN HAME1 



CTSS PPCGRAMMES'3 GUIDE Section AH. 7.03 5/66 2 

The CONTIN command should te used to resume a progratn 
involving a chain of couaiands. It restores the program and 
fflichine conditions from NAHE1 SAVED, together with any 
active files, the cocciaon file switching, and the contents of 
the command list, comniand location counter, and current 
commana buffer. In other words, it is exactly equivalent to 
the chain of RECALL and HSTART. 

Summary 

RECALL RESTOF 

RSTARl START 

COSTIH RESUME 

1. Restores coniniand 1. Does not restore 
buffers. coannand buffers. 

2. Restores chain, 2. Coes not restore 
if any. chain. 

3. Restores directory 3. Does not restore 
switching. directory switching. 

H, Will not over- U. «ill over-write 

write connand coBinand buffers, 

buffers and com- 
mand list. 



(END) 






Identification 

Relocatable program loading 
LAED, USE 

Puc£OS_e 

LAED (Load AED) is a loader originally developed by the 
Elaatronic Systems Laboratory group for use with AED (see 
AH.2.01). It has several features which the standard loader 
(AH. 7. 01) does not. 

There are tour different types of loading available for 
relocatable programs in either BSS or SQZBSS foriaat. All 

four types are contained in the single LAED command. The 

typa of loading desired is selected by typing one of four 
options following LAED. The first loading option LOAD will 
load a prograni into core without destroying the loader or 
MOVIE) table, place the program in dormant status and return 
to the user for the next command. The second option LOADGO 
is tha result of a LOAD followed by the command START. The 
third option VLOAD will load the program, move all of the 
program and COMMON down in core to destroy the loader and 
HDVIE) table (thereby making the available core larger) , 
place the program in dormant status and return to the user 
for the next consBand. The fourth option MCLOAD is the same 
as VLOAD except that erasable COMMON is also destroyed so 
that no library routines which use erasable COMMON may be 
used. 

Programs or files may be loaded (or searched as library 
files) from the user's file directory, from his conimcn files 
and from several system files. 

If needed routines cannot be found by the loader, the USE 
command may be used to specify which routines may be used 
instead. 

The list of files to be loaded, intermixed with the various 
loading options, may be placed into a separate disk file 
(second name LOAD). This LOAD file may then be referenced 
in the LAED command line, and the effect is the same as if 
the file contents had been typed by the user. 

Two forms of MOVIE) table may be produced, the standard 
format or the format suitable for use with the 
LDADEB/UNLOADER system (MAC-M-286). The latter contains all 
of the standard information, plus program size data. 
Regardless which of the two types of MOVIE) table or which 
of the four loading types is requested, a file narotid (MOVIE 
TABLE) is written (in temporary mode 00 1) and added to the 
user's directory, which contains the MOVIE) information. 



CTSS PROGHAWMER'S 31JIDE Section AH.7.0U 7/66 



This tile is in a binary format which is not directly 
printable, but may be used by any of the available utility 

programs. 

The loader may be used as a subroutine during execution of 
an objact program for the purpose of resuming the loading 
process. The LOAD or LOADGO options cause the loader to 
insert the subroutine entry (LOAD) in the WOVIE) table for 
this purpose. Since the entry point (LOAD) is part of the 
loader itself, (LOAD) is not put in the KOVIE) table when 
VLOAD or NCLCAD is used. 

Maximum table sizes are: MOVIE) table is 10 80 words, the 
tibia of missing entries is 100, and the uaximum size of a 
LDAD file is 4U lines. The »»missing entry" table is not 
continually maintained, tut is generated when needed (just 
before a library search or at the conclusion of loading). 
Therefore, it is possible during loading to temporarily 
build up more than 100 missing entry points without causing 
a fatal loading error. 

The type of loading desired (LOAD, LOADGO, VLOAD, or NCLOAD) 
is typed immediately following LABD. If no option is typed, 
LOAD is assumed. The remainder of the command line is a 
series of special and nonspecial argunents. Special 
argumants are those beginning and ending with parentheses as 
shown below. Nonspecial arguments are either file names or 
antry points, depending upon the preceding special 
ar gusaents. 

Upon coapleticn cf loading, the user is left in the file 
airactory he was in immediately preceding the LAED command. 

The following paragraphs describe each of the special 
arguments recognized by LAED. 

(ORG) The presence of the (ORG) option instructs the 
loader to set the starting address to the entry 
name specified fcy the next nonspecial argument 
following (ORG). 

(NEED) The presence of (NEED) instructs the loader to 
treat the next nonspecial argument as a program 
entry point as though it had been an entry in a 
transfer vector of one of the binary files 
already loaded. 

(MORE) may be the last argument before the carriage 
return (because only one line can be 
interpreted by the command) to indicate that 



Qar'+irin BH 1 Ci tl l/ftfx 



Bore arguaents will be specified. In this case 
the loader will not print the HEED list; will 
restore the common file switching to the 
initial setting: and return to the user (by way 
of CHNCOH) so that the USE coniaand aay be used. 

(CFLn) directs the loader to switch the current file 
directory tc coamon file directory n which may 
be through 9 or P. The current file 
directory is initially the user's file 
directory or a directory set by a COHFIL 
coanand. There may be any number of switches 
in an argument list and each one supersedes the 
previous one. 

(LIEE) directs the loader to use the next ncnspecial 
argument as a file within the current file 
directory to be searched as a library file to 
find any missing routines. The file is 
searched repeatedly until one coaplete pass 
through the library is male in which no 
additional needed routines are found, or until 
all needed routines are loaded. 

(SRCH) has the same effect as (LIBE) except that only 
Dne pass is made through the library. The 
argument (SBCH) thus assumes that the library 
is properly ordered so that no program 
references any program which occurs before it 
in the library, thus saving load time. 

(SYS) directs the leader to use the nonspecial 
argument following (SJS) as a file from the 
system file directory to be searched as an 
ordered library for any missing routines. The 
argument (SYS) is exactly equivalent to the 
argument seguence (CFLP) (SBCH). The loader 
automatically performs a (SYS) TSLIB1 at the 
end of a LAED comnand whether or not any other 
libraries have teen searched, and without any 
specific request by the user, if there are any 
missing entry points. 

(NLIB) directs the loader not to search the system 
library rSLIBl for missing routines after the 
argument list has bean processed. 

(LIB) supersedes (NLIB), thus restoring the automatic 
(SYS) rSLlBl search at the conclusion of 
loading . 

(SQZ) The argument (SQZ) instructs LAED that all 
indicated binary files following (SQZ) on the 
coirmand line are in the S3ZBSS format. 



CTSS FBCGRAKMEB«5 GUIDE Section AH. 7.04 7/66 U 

SiiBilarly, (BSS) teturns LAED to the BSS mode. 
If neither argument is specified, (BSS) is 
dssumed. The established mode also applies to 
all lead files. LAED automatically switches to 
(BSS) mode whenever a new command line is typed 
(i.e. a USE or a START comniand after a NEED 
message) . 

(AEDP) This conmand searches the system library AEELBI 
for missing routines. The argument (AEDP) is 
exactly equivalent to the sequence (CFLP) 
(SBCH) AEELE1 . 

(UNLD) causes LAED to produce the KCVIE) table and the 
file (MO/IE TABLE) in the proper format for the 
LOADER/ UNLOADER system. The argument (UNLD) 
must appear before any binary file names on the 
coBiand line. 

(GET) instructs LAED that succeeding nonspecial 
(NGET) argument file names are LOAD files, rather than 
BSS or SQZBSS files, (NGET) returns LAED to 

the normal mode (succeeding file names are of 
type BSS). A LOAD file consists of a sequence 
of standard 14-*jord card images, with the name 
of a BSS file, SQZBSS file or special loader 
argument appearing in columns 1-6 (one argument 
per line). The argument may appear anywhere 
within these six columns, and LAED will 
right -justify the word. Columns 7-72 are 

ignored, and may be used for comments. LAED 

also ignores any line containing blanks in 
columns 1-6 or an ♦ in column 1. 

Ths above is an exhaustive list of the LAED special 
arguments. If any word is typed in the LAED command line or 
LOAD file which is not one of the above, it is considered to 
be the primary name of a BSS, SQZBSS, or ICAD file, or an 
entry point, depending upon the special arguments preceding 
it. 

The following is a list of the various on-line user and 
system typed statements used to communicate with LAEE. 

MEED Following the processing of the argument list, 

the system library TSLIBl will be searched for 
any missing routines (unless prohibited by 
(NLIB)). If routines are still missing the 
current file directory is switched to the 
initial directory, a list of needed routines 
(by entry names) is typed by the loader and 
DORMNI is called so that the user may type the 
USE command. Upon completion of loading, the 
current file directory is switched to its 



ntlTnP <iar^*^nT\ h» 1 CitX l/f>f\ 



initial status. 

USE When USE is typed by the user, LAED reinstates 

the last common file switching and restarts the 
loading process. All of the arguments 

available to the loader are therefore available 
to USE. USE may be used to satisfy a NEED 
statement, or tc load additional routines in an 
existing file originally created by LOAD or 
LOADGO types of loading. 

LAED LOAD Sets the origin of the first program at 

(7000)8. The MOVIE) table and the loader are 
left inviolate below this origin. COHMON 

addresses are relocated with the same parity as 
on the assembly listing. FAP coded subprograms 
which contain the EVEN pseudo op, will be 
loaded with relative location in an even core 
location. Upon completion, all loaders call 
CHNCOM with an available core image specified. 

LAED LOADGC is equivalent to the sequence of a LAED LOAD 
followed by the command START. 

LAED VLOAD After the entire program and library 

subroutines have been LCADed the program is 
moved down so that the origin is (30)8, 
covering the loader and the KCVIE) table. The 
(316)8 words of erasable COMMON are included 
with the prcgraa. The MOVIE) table will be 
preserved if MOVIE) occurs in the transfer 
vector cf any routine loaded. 

LAED NCLOAD is the same as VLOAD except that the (316) 8 
words of erasable CCMMCN are not included and, 
therefore, if library subroutines which use 
erasable common are included, a COHMOM 
assignment error message will be printed. 

AEtar the user has typed any of the above LAED or USE 
commands, LAED attempts to perform the indicated loading 
operations, and prints on-line alarms to report error 
conditions. These alarms are caused by three conditions: 

1. Overflow of LAED tables or core memory (fatal). 

2. Hissing files or entry points (ncn-fatal). 

3. More than 1 entry point with the same name 
(non-fatal) . 

If the loading is successful, the final operation performed 
by LAED is to produce the (MOVIE TABLE) file. 

Th^ MOVIE) table is created by the loader to provide a 
storage irap cf all entry points of routines as they are 



CrsS FPCGRAMMER«3 GUIDE Section AH. 7. 04 7/66 6 

loaied. It is always written as a file (MDVIE TABLE) in the 
user's directory in tempcrarj mode. If the entry MOVIE) 
appaars in the transfer vector of any routine loaded, by 
VLOAD or NCLOAD, the MOVIE) table will be preserved by 
moving it to the top Df the load. The KCVIE) entry points 
to location (278) which contains the MOVIE keyword which 
contains the number of words in the movie table in the 
ii-ramant and the location of the lowest word in the movie 
table in the address. Ihe fornat of the MOVIE) table, 
starting with the lowest location, is: 

1. fence 

2. Lowest comnon break (address) 

3. SVN prefix 

U. Memory bound (address) 

5. BCD entry naiue 

6. Entry point for previous name (address) 
Pairs of word 5 and 6 for each 

entry to the subprogram. 

7. SVN prefix or PZE , ,n , where there are 

n words in this program's transfer vector. 

8. Origin of this subprogram (address) 
Hepeat groups 5 through 8 for each 
subprogram loaded. 

The format of the MOVIE) table created in conjunction with 
an (UNLD) loading argument is identical to the above format, 
except that item 7 is: 

7. SVN prefix cr PZE m, o, n, where there are m words 
in this progcam and n words in its transfer vector. 

Provision has been made to allow the use of LftEt as a 
subroutine during execution of an object program. The LOAD 
or LOADGO entries to LAED cause the loader to insect the 
subroutina entry (LOAD) in the MOVIE) table. Since the 
entry (LOAD) is part of the loader itself, (LOAD) is not put 
in tha MOVIE) table when VLOAD or NCLOAD is used. For the 
same reason, a VLOAD or NCLOAD may not be initiated from an 
object program during execution. 

Th3 usar calls the loader by issuing the instructions 

TSX (LOAD), a 
♦♦* LIST,,N 
(artor return) 
(normal return) 

LIST is the start of an array containing the file names to 
b2 loaded either right-justified or left- just if ied stored 
forwards in memory. N is the length of the list. 

*♦* controls the printing of missing subroutines. If ♦♦♦ is 
PZR these will be listed by LAED, The message will be 



'cc DDDCDAMMPDlc 'illTnP dar^Unn AHlOil Tyfifc 



supreased if MZE is used. 

Whether cr net the on-line ptintout of missing subroutine 
nainas is requested, the error return is taken when one or 
more routines or files are missing. When this happens, the 
AC oontdins a pointer to the list of missing subprograms so 
that the user may use the information as he desires. The 

list tarminates with a word cf all zeroes. If only files 
its missing, the AC is zero. 

LIST may contain any desired loader commands such as (LIB), 
(NLIB) , etc. If the sequence (SET) BETA is used it should 
b^ at the end of the list. If it occurs elsewhere, the rest 
of the list will be ignored. 



CTSS PROGHAMMER'S GUIDE 



Section AH. 7. 04 



7/66 8 



SrOfiAGE MAP 



(L0CATI0N)8 

0-7 

10-23 

2U 

25 

26 

27 



CONTENTS 

ZERO 

BOOTSTRAP for NCLOAD and VLOAD or TSX LQAD,U 

ISX (ORG) ,4 

TSX (0RG2},a 

TSX i0BG3') ,U 

MOVIE) Keyword 



30 



6U31 



^000 



1 



LOADER 

FOB 
LOAD , 
LCAEGO 



PFOGRAM 



COMHON 



ERASABLE 



COMMON 



EPOGRAK 

MB1 



VLOAD: 

PROGRAM 
COMKCW 

TO 
(77461 )8 



ERASABLE 
COMHCM 
TO 
(77777) 8 



PROGRAM 



MB2 



NCLOAD: 

PROGRAM 
COMMCS 

TO 
(77U61)8 



PROGRAM 



MB3 



MB3 = 30 + 77U61 
MB2 = 3 16 + MB3 
MBl = 6U31 ♦ MB2 



COMMON BREAK + PRGGRAR LENGTH 



(END) 



1 'J y£ o 



L^entiJicaticn 

Exaauta saved programs froai common files 
DO 

Purgose 

DO enables the user to execute saved programs from his 
common files or from the public file directory without using 
links. 

Usa^e 

DC n NAME argi arg2 ... 

DO will switch to the directory specified, lead the 
saved file "NAME SAVED" into core, and start it at location 
2U (8) . Mo machine conditions are restored. "NAME" will 

have its arguments available to it just as if it had been 

RESUMEd. 

The parameter "n" specifies the location of the saved 
file. If "n" is "♦ ", the saved file is leaded from the 
jurrant directory. If " n" is "P", the sdvel file is loaded 
from the system public file (MU16 CHFLOU). If " n" has any 
other value, the saved file is loaded from the user's common 
file "n". 



(END) 



r-TQG Dorrin iMM PR»Q r:riTnP t^oi^f inn iH_7_nft 15/fiQ 



Simulation of the loading commands 
PLOAD 

Purpose 

PLOAD simulates the loading of a system through the use of a 
load file. It will produce a list of missing files and/or 
subroutines, if any, as well as a c^ross referenced storage 
map. 

Usaje 

FLCAD NAME -type- -«COMB«- -»NOLIST'- 

SAME The primary name of the LOAD file from which the 
list cf files is tc be taken. The secondary name 
is "LOAD" and the file must ba line numbered. 

type may be used to specify the type of loading 
desired. If a type of "NCLOAD" is used loading 
will be siuulated starting at 30(8) ; if the type 
i.s "VLOAC" t-hff loading will fce simulated starting 
from location 346(8); otherwise 7C00(8) is used 
when preparing the cross reference storage map. 

COMB is used when one or more of the files is a library 
(i.e. contains more than one program) . 

NOLIST is used to suppress the creation of the cross 
reference storage map (NAME STCKAP). 

Ei s t ri c t i o n s 

Uniar the present implementation of PLOAD it is net possible 
to use the special options recjognized by the LAED loaders 
{2.g. "(IIBE)**, "(SBCH)", "(CFLn)" etc.). 

Nota also that PLOAD does not relocate program common, as is 
done by the relocatable loaders. Therefore, if any common is 
used, the loading addresses shown in the storage map will be 
incorrect by the amount cf common in use. 



(END) 



CTSS PHORRAMMEH * S r;ijTDF. Section AHe7,07 12/69 1 

I dent if icatign 

Set executicn timing response 
BLIP 

Purpose 

To allow a user to set his 'blip* switch from coiaiaand level. 

Usage 

To set the ' blip* : 

BLIP -n- 

If ' n' is not specified, it is assumed 2. If n , NE. 0, the 
command responds with 'Type: '. The following characters, up 
to but not including the carriage return, and to a maximum 
of thraa {12-bit characters) will thereafter be typed on the 
user's terminal every 'n' seconds of execution time. 

To reset (turn off) 'blip*: 

BLIP 

The switch indicating that the user has his 'blip' option on 
is resat, and the command exits. 

Example 

The character sequence 'space backspace' is useful, since it 
3o3s not cause any printing, but gives evidence of execution 
timing by the carriage mcticn. 

Note: Swap time and disk-command load time are not included 
in 'execution time' for this application. 



(END) 



eras PFC(iKABnBH*s ouiDE section ah./. 08 M/hH 



Jl^ntifi cation 

Dispatching tc and Accessing TIP Utility ErogratBS and other 

Da ta -manipulation Programs 

RUN 



Purpose 

Tha RUN system provides a uniform method of obtaining access 
to programs associated with the use of the TIP 
data -manipulation system. 

TIP usars have occasion to employ many different programs in 
the process cf establishing data bases, manipulating data, 
and formating useful out pat. Some programs are of command 
status (e.g., CEC) , some are public commands (e.g., TAPLF) , 
some are maintained in TIP common files (e.g., SORT), some 
ara accessible exclusively through the RUN system (e.g., 
PUTOUT), and soHie are EDIT, F&P, and MAD programs written 
and maintained by individual users for their own purposes. 
The RUN system makes accessible in a uniform manner programs 
ot all five types. Ihis simplifies the naze of links, saved 
files, cdlliriij iieyuences, etc., which confronts the CISS 
usar- Tha system insulates the user from "hanges in system 
OLgani Zdi tion , ate. and relieves him fron saintaining many 
links to many saved files. 

The RUN system permits a number of programs to be loaded in 
a single saved file. If these programs call many of the 
same subroutines, then by eliminating the duplication of 
these subroutines over many saved files disk storage is 
conserved, at the cost of a very slight increase in 
execution time. 



Usaie 

The calling sequence for RUN is: 

RUN COWAND -ARGl- ... -ARG17- 

CanAND is any program listed in the file, BUN SYSTEM, 
which is described below; or any TIP coiBand, or 



any saved 


file in the 


user 's 


current 


file 


directory. 


or any public 


coniBand 


or any 


CTSS 


coff mand . 











-ARGl- ... -A R3 n- are the arguments to COMAND, if any. 



CTSS FPCGRA«MiiR«5 GUIDE 



Section AH. 7-08 



12/69 



RUN reads an internal table to ietermine if COWAND is a RUN 
3oai(nand, and it sd, which saved file contains it. SUN then 
attaches tc TIPFIL, P1U959 CMFL02, where tha HUN saved files 
and TIP commands are found and attempts to resume the proper 
saved file. If the desired saved file cannot be found 
there, RUN will look in the user's own directory. If this 
is unsuccessful, RUN attaches to the public file, M1416 
CMFLOU, and makes another attempt. If the saved file is 
still not found, COMAND is assumed to fce a CTSS consniand and 
NEXCOH is called. If COMAND is found in a saved file, HUN 
rssumss the praper saved file, transferring control to the 
called pro.jrain, except when the program is contained in a 
RUN saved file, in which case an intermediate program 
returns to free storage all sabroutines not used by the 
::ill3d COMANE before transfering control to the entry point 
of COMAND. 

Th- 6-bit line-marked file, RUN SYSTEH, in MU959 CMFL02 
contains a list of all available SUN programs and the saved 
filas in which they are found. It may be LINKed to by any 
user and PBINTed: 

run lirk run system m4959 cmfl02 
run print ran system 



Examples 

A user wishes tc convert some personal information to IIP 
format. He might use the following seguence of commands: 

run eda my field 

FILE MY FIELD NOT FOUHD. 
Input 
*! nameladdress! phone 

Edit 
file 



run reduce my field my fid 052 041 
1 items in , 1 out . 






run eda my input 

FILE MY INPUT NOT FOUND. 

Input 

♦ 

! name John D. Smith 
laddress 2 High Road 
! phone 864-6900 

Edit 
file 

* 

run reduce ay input my data 052 041 (tabl) my fid 
1 iteiES in, 1 cut. 

The file KY DATA now contains ri P-searchabla information 
datailing the personal situation of John D. Smith. 

Suppose that a user had a large file named CIG DATA 
containing data about newspaper articles on cigarettes, 
including the authors' last names in field 3 of each item. 
Than , 

run sect cig data cig sorted 3 

will create the file CIG SORTED with items sorted 
alphabetically by author's last name. 

If a user wants to put all files with first naae LASfR into 
a tape (or disk) file LASER FILE, and to delete the separate 
files, he might proceed as follows: 

run listof (off) laser direct laser ♦ (Inair) 
run putoat laser direct laser file 
rua deldir laser direct 

If he later wanted to know just which files were in the file 
LASER FILE, he cculd: 

run p laser direct 

and to get the separate files back, he could: 

run pullin laser direct laser file 

These examples illustrate the uniformity which is available 
to the occasional user of CTSS, when he is using programs 
related to data- Ba nipula tion. PUTCUT, DELDIB, REDUCE and 
PULLIN can be reached only through the RUN system; SORT and 
LISIOF are independent saved files kept in TIP common files; 
and EDA and E are CTSS commands. However, the user need not 
know or remetober these facts. He can reference the programs 



CTSS FPCGBAWMhR'5 GU ICB Section AH. 7. 08 12/69 U 

hi nssds -iuite efficiently using the single vehicle cf RUN. 

Tiie RUN cotrirancls presently available are these: 

ADDJN, APPND, ASC2HK, ASEMBL, BLIP, BSSEDT, CARDMK, CHKPIK, 

cur, DELDIR, DQUELE, EXPAND, F IBCH K , FPfilBT, FBEgUE, ISEEX, 

INTEFM, IPATCH, MAKCOE, MAKLOD, MAKTIA, NOTE, PULLIN, 

PUraUT, Q5DI1, KEDU, REDUCE, REJOIN, REMAKE, RENUMB, HEVNAM, 

SAMPLK, SEqUEN, SPREAC, SQUASH, TALLYB, TALLYT, TRIPLE, 
TSTOCK, UP SORT. 

The TIP coDftiiands presently available include: 

CALC, C3MPIL, ::VFILE, DCALC, DISPIC, DISEIY, EDIT, ENTCNT, 
FORMAT, FREI, LAEEL, LISTOF, MERGE, RNAME, SETFIB, SHARE, 
SIZE, SORT, TAP, TIP, VERIFY. 

S^^tr ict_ion 

Whenever a nama conflict exists between, e.g., a public 
3omniani and a RUN CDmsiand, then only one program can be 
referenced through the RUN sjstem. For this purpose, RUN 
-ommands take precedence over TIP coimiands which take 
precedence over private commands which take precedence over 
public commdnds which take precedence over CTSS ccBniands. 
An up-to-date listing of the RUN commands is kept in the 
fil3 RUN SYSTEM. 



(END) 






Ganaral dlscussioa of debugging commands. 

Method 

Thare are three different kinds of commands within CTSSf one 
of whi:;h is of nc importance in this discussion. The first 
kind is often referred to as a "disk-loaded" command. The 
iistinctive property is that the supervisor loads the 
command from a cere image SA VEd file and thereby eliminates 
iny previous core image the user night have had. The second 
kind is often referred to as a "core-B transfer" command. 
H3r3 tha distinctive property is that the supervisor does 
not load the comaiand, but instead, transfers to the 
relocating loader which is already in core-B. The loader 
then determines which command is specified and proceeds to 
loai the command from a standard BSS library file (TSLIB2) 
into the area of core above the current core image. If the 
command has already been loaded, the loader merely transfers 
to tha desired entry point. 

Soma of the present debugging commands are core-B transfer 
commands. The earliest routine available to CTSS was 
called FLEXEK which includes the commands EM, PATCH, STOPAT, 
and TRA. More sophisticated commands have been written more 
recently, such as FAPDBG and STRACE. These routines are 
able to make use of the tables created by the translators 
and the loader, such as the MOVIE) table and symbol table 
filas. The use of these commands imposes some restrictions 
on the user, namely that the vanishing and absolute loaders 
not ba used and that the symbol table files from the 
translators be available and of the proper format. 

Programs which extend the memory bound during execution 
::r3ate some problems in connection with the debugging 
routines. Note that the core-B transfer commands are 
relocatable BSS subroutines with normal entry points. If 
the debugging routine is loaded after the program has 
started execution, there may be a conflict about the space 
acquired by expanding aemory bound. Therefore, the solution 
is to force the debugging subroutines to be loaded with the 
program before execution. This may be accomplished either 
by placing one of the entry points in a transfer vector of 
one of the loaded programs or by use of the special 
arguments to the LOAD command. 

Th3 SF command is a disk-loaded command which may be used 

only by the system programs for patching core-A. The SC 

:::'jmmana may generally be used for examination of locations 
in core-A, 

The MADBUG ccmmand is a disk loadad command which serves as 
an intermediate supervisor between the user and the CTSS 



CTSS PROGRAMMSa'S SLIDE 



Section AH, 8. 00 



Page 



sapervisoc. MADBUG allows the user to specify a KAC source 
fiia rathar than BSS file. KADBUG manages all th« calls to 
the MAD ttarslatcr and the appropriate loader: so that the 
i. t;s L r xc t lo fiS ii8j.lieu by tue core — i3 trdnsfer routines are not 
as avidant to the user. 



(END) 



tTi»S tijUUiCflnniin 'i vaU iUi oc:«-»,iuii nii.u.ui Page 



liSfitif ication 

FAPDBG - A symbolic debugging aid for PAF program 
R. H. Campbell 

Pur£Osa 

FAPDBG, as a symbolic debugging aid for FAP programs, was 
prolucad as an experiment with typing conventions and 
formats. FAPDBG acts upon requests typed by the user on the 
ronsola and performs such functions as examining and typing 
or changing the contents of specified registers and allowing 
a subprogram to be run in controlled segments. 

Rata ranee 

CC-2 16 FAPDBG, a symbolic debugging aid R. H. Campbell 



Osa^e 

LOAD NAME1 ARGUMENTS 

FAPDBG ALPHA 

requests 

Th2 FAPDBG command can be issued anytime a program is 
dormant ap.d the loader is available, i.e., may not have been 
loaiad by a self-erasing loader. If the program extends 
memory bound or damages the loader, FAPDBG should be called 
befora axacution. The FAPDEG command calls the loader to 
load the FAPDBG subprogram from the debug library, "TSLIB2". 
FAPDBG uses the loader's symbol and loading tables to build 
its own symbol table (800 symbols maximum) for the 
subprograms which the user wishes to debug. FAPDBG is 
approximately (12400)8 locations in length. 

If tha line-numbered file ALPHA DEBUG can be found, requests 
are taken from there. When ALPHA DEBUG is exhausted, not 
found, or not specified, requests will te taken from the 
console. 

Conventions: 

1) A request is a single letter request name followed 
by arguments, all separated by tlanks. 

2) A blank is a string of any number (not zero) of 
spaces or tabulations. 

3) Any number of requests may be concatenated on one 
line by typing an apostrophe or an equal sign 
between successive requests. Concatenation is 
recommended since FAPDBG will be brought into core 
lass often and will generate less output. 

4) If a request cannot be accomplishad , FAPDEG will 
so inform the user and return to process the next 
request. 



crss t BCGBAKflER'5 GUIDE Section AH. 8. 01 Page 



5) Syntax - The location, address, tag, and decrement 
parts cf a request argument may consist of strings 
of symbols and octal numbers separated by plus and 
ainus signs to denote the desired algebraic 
manipulation. The indicated operations are carried 
out, any negative result is converted to two's 
conpleinant form and the right fifteen bits saved 
(in the case cf the tag field, only the right 
three bits are saved). Symbols, which Bust be 
defined, may consist of any number of characters, 
at least one of which must be non- numeric (i.e., 
not through 7) , and none of which may be one of 
the special characters plus, minus , coffima, space, 
or tabulate. If the number of characters is 
greater than six, only the last six will be used. 
Any string consisting only of the digits through 
7 will be considered an octal number of five 
digits, with left zeros if necessary- If more than 
five digits are typed, only the last five will be 
used. The line typed in is scanned froa the left 
and each field is evaluated when encountered. If 
an undefined symbol is discovered, or a deviation 
from an understandable format is discovered, an 
appropriate comment is typed and processing of the 
request is terminated. If one or more requests 
cannot be interpreted, any 3_o or £roceed requests 
following them on the ^me line will be ignored. 



p'T»c:c; c una. qammvoaq raiTPc c^^^- ^ ^r* ru o r\i n-.^^ -^ 

Thara are four classes of requests: set up, register 
examination and modification, subprogram control, and FAPDB3 
control . 

SJT UP BEQUESTS: 

Tha S3 1 up requests ace necessary to tell FAPDBG which 
subproyrains are to be debugged and allow FAPDBG to build the 
nacassary symbol tables. These requests are Load address, 
symbol Table, Work, and Equals. 

LOAD ADDRESS: L ENTBY 

ENTRY is an entry point of the subprogram to be 
debugged. The origin of the subprogram will be 
typed cut and nill be used as the relocation 
constant for all symbols within that 
subprogram. 

SYMBOL TABLE: T -NAHEl- 

All the syjibols from the file SAME! SYMTB will 
be relocated by the origin printed from the 
last L request and placed in the FAPDBG symbol 
table. Note that this means absolute symbols 
and COMMON (except for the first- loaded) will 
be incorrect. 

Successful completion is signaled by "SYMBOLS 
LOADED". If the FAPDBG symbol table becomes 
full, the last symbol entered will be typed 
out. Note that the symbols in the SYMTB file 
are in alphefcetic order. 

If NAME! is omitted, all of the symbols will 
be deleted from the FAPDBG symbol table. 

W3RK: W ENTRY -NAHE1- 

V is the combination of L and T requests, 

NAME1 need net be specified if EKTHY and NAMEl are 
the same. 

EQUALS: E FE FS 

FS is the symbol to be entered in the symbol 
table with the value of the expression FE. 

FE is a FAP expreesion involving constants and/or 
symbols already entered in the symbcl table 
(see convention 6.) 



CTSS EBCGHAMMER'3 GQIEE Section AH. 8. 01 Page U 

i^!ii§lS£ Ixaiii}^ tipn and ilodif ication 

Tiia cijister exaiain atior. ar.d ir.odif iC3 tier raqiiests persit 
the usee tc examine and change the contents of core 
locations as well as the live ragistets. They are look 
(floating point, Hollerith, tull word integer, decrement 
integer, octal, symbolic), deposit, compare, signed and 
logical accumulator, and storage map. 

LOOK: -request- -LOCI- -L0C2- 

raquast sets the output conversion mode and if an 
argument is spe-ified, prints the specified 
locations. Request may be one of the 
f cllowing: 



F 


Floating point 




H 


Hallerith 




I 


Full word integer 




J 


Eecrement integer 


(Fortran) 





Octal 




S 


Symbolic 





LOCI L0C2 ate FAP symbolic expressions specifying a 
block, of core from LOCI through L0C2. 

LOCI specifies a single location. 

The contents of a single location in the 
current output mode may be obtained by typing 
just the location expression without the look 
request with the restriction that the first 
symbal in the expression may net be a single 
letter. The contents of "* + 1" may be 
obtained by an empty request (just a carriage 
return or concatenation character) . 

DEPOSIT: D LOZ FW 

FM is the FAP viord to replace the previous 
contents of location LOC. 



This request may be abbreviated by omitting 
the request name, provided that the location 
expression does not begin with a single-letter 
symbol. The FAP word nay be a symbolic machine 
instruction such as CAL AIBHA-10,U or one of 
the data generating pseudo instructions OCT, 
BCD, FLO, TNT (full word decimal integer), or 
JNT (decrement integer) followed by a blank 
and one word of data. 



A symbolic machine instruction consists of a 
symbolic ofetation code, an optional asterisk 
to indicate indirect addressing, and an 
optional variable field in the sane format as 
accepted by FAP, except that all numbers are 
interpreted as octal and that multiplication 
and division are not allowed* Ho blank isa y 
intervene between the operation code and the 
indirect flag; a blank must, however, precede 
the variable field. Note that since the 
address field is truncated to fifteen bits, 
the left three bits of the address part of 
type D instructions (left and right half 
indicator operations) will be considered by 
FAPDBG as the tag field, both for input and 
for output. Thus to insert the instruction 

RFT 300 105 

it is necessary to type 

RFT 105,3 

The OCT ^seudo instruction accepts a sijned or 
unsigned octal integer of magnitude less than 
->r eiaal to 377777777777. Thus, tc insert the 
traditional fence, it is necessary to type 

OCT -377777777777 

The FLO pseudo instruction accepts a signed or 
unsigned floating point nuaber with optional 
decimal point and optional E modifier to 
denote multiplication by the indicated power 
of ten. The B modifier is not allowed. 

The INT and JNT pseudo instructions accept 
signed or unsigned decimal integers of 
sufficiently soall magnitude to fit into the 
number of bits available (3U359738367 for INT 
and 131071 for JNT), 

The DCr pseudo instruction accepts any string 
of characters preceding the request terminator 
and assembles the last six into one word. If 
fewer than six characters are typed, spaces 
will be inserted on the left. Dote that this 
pseudo instruction uses the input line image 
after PAPDB3 has edited and "normalized" it. 
Therefore a string of spaces and tabulations 
will be interpreted as a single blank. 

COMPAKE and VERIFY: C ENTRY -NA»E1- 



CTSS EBCGRAKttEB'5 GUIDE Section AH. 8. 01 Page 



ENTRY is the entry point of a subprogcam already 
leaded in cote. 

NAME! DSS is the na aie of the file which is to be 

compared with the core image of ENTRY, NAHE1 

need net be specified if it is the same as 
ENIR Y. 

C by using the origin value of the ENTRY 
subprogcam, it will read and relocate each 
word in NAME1 BSS and compare it with the 
corresponding word in core. If a discrepency 
is found, FAPDB3 will type in the current mode 
the location, the word freic NAME1, and the 
contents of the memory location for which 
there is a discrepancy, "EXAMINATION 

CONCLUDED" will signal the completion of the 
request. The reguest may be terminated by a 
single interrupt; FAPDBG will close the BSS 
file and return to process the next request. 

ACCUMULAIOH: A -FS- or K -FW- 

A places the FAP word »PH* in the signed 
accumulator and clears the P and Q bits. 

K places the FAP word • FM' in the logical 
accumulator and clears the sign and Q bits. 

A {or K) without argument types out, in the current 
mode, the contents of the signed (logical) 
accumulator followed by the P and Q (sign and 
Q) bits. 

STORAGE KAP: M 

M requests the typing of the storage map with 

subprograms listed in order of loading. The 

map includes the origin and entry points with 
their locations. 



Subarogram Control 

The requests which have to dc with subprogram control allow 
tha user to run his subprogram in controlled segments. They 
it?, break, g^o , and proceed. 

BREAK: E -LOC- 

Conditijns FAPDBG to insert a "breakpoint" at 
location LOC. FAPDBG will save the location 



PROCEED : 



CTSS FRCfiRAMMKH««; ntlxnF <:oo*- 



and set an indicator to signal that a 
breakpoint instruction, specifically a 

transfer into F&PDBG, is to be inserted into 
that location. So subprcgraia aiodif ica tion 
occurs at this time. An examination of the 
breakpoint location will reveal its original 
contents and changing the contents (via a 
deposit request) will not remove" "the 

breakpoint. Ihe breakpoint must not be placed 
at a subprcgram-modif ied instruction or where 
it would be used for indirect addressing. 
Only one breakpoint at a time may be inserted. 

The omission of LOC in the request causes the 
breakpoint to be removed. 

GO: G LOC 

Allows the user to start execution of the 
subprogram at location, LOC. FAPDB3 will 
examine the breakpoint flay and, if a 
breakpoint exists, will save the contents of 
the break location and insert the necessary 
transfer instruction. It will then restore the 
machine conditions, and transfer to the 
specified location- 



Allows the user to continue executing his 
subprogram from the state it was in just 
before control last entered fAPDBG. Upon 
encountering the breakpoint transfer 
instruction, control will be transferred to 
FAPDBG, which will save the machine conditions 
and restore the temporarily-removed 
instruction at the break location. FAPDBG will 
then type »'BRE&K.« and wait for requests. 

Proceed will cause FAPDBG to perform all the 
steps performed by jo, except that after 
restoring the machine conditions, FAPDEG will 
execute the above-mentioned instruction and 
transfer to the appropriate location following 
its location as governed by any skipping which 
might occur. If the instruction is 
location-dependent, namely 'XSX, STR, SXL, or 
XEC, FAPDBG will interpret it as if it were 
being executed from its normal location. Thus 
a breakpoint may be inserted at a subroutine 
call. A chain of XEC instructions will be 
interpreted to a maximum depth of ten. A 
subprogram in operation may be interrupted at 



crss EPCGRAMMER»3 GUIDE Section AH. 8. 01 Page 8 

any time by pressing the interrupt button. 

lUlSIUii Ogera tion 

Th3 raquest which controls the internal operation allows the 
user to return tc CTSS. It is guit. 

QUIT: Q 

Returns control to the Time Sharing Supervisor 
in such a way that a START coamand will 
transfer control to the place in the user's 
subprograoi where it last entered dormant 

lUJternal Sjfmbols 



sta tus. 



The following symbols are permanently defined in FAEDEG as 
locations where the machine conditions are stored. 

$MQ The itultiplier-quotien t register. 

$A The signed accumulator 

$K The logical accumulator 

$SI The sense indicator register. 

$X1 Index register one- 

$X2 Index register tho. 

$X3 Index register three. 

$X4 Index register four. 

$X5 Index register five. 

$X6 Index register six. 

$X7 Index register seven, 

* The current location. 

This syabol is defined as the last location 
referred to by either the user or FAPEBG. It 
is redefined as the location of the next 
instruction tc be executed in the user's 
subprogram by encountering a breakpoint or by 
a Banual restart. 

SLS Lights and switches. 

This location contains the state of the 
machine conditions in the right-most eight 
octal digits as listed below; the off status 
is represented by zero, on status by one. 
Beading from left to right: 






DIGIT CONDITICN 

5 Floating point trap mode, 

6 Divide check light. 

7 Overflow light. 

8 Multiple tagging light. 

9 Sense li^ht one. 

10 Sense light two. 

11 sense light three. 

12 Sense light four. 



$IC The instruction location counter. 

This location contains the address of the next 
instruction to be executed in the user's 
subpcogc am . It is set ty encountering a 
breakpoint or by a manual restart. It is 
examiQed by the proceed request in order to 
determine the location to which to transfer 
control. 



CTSS PROGRAMMER'S 3UIDE Section AH. 8. 01 Eage 10 

Summary of Requests in Al£habeti2. Qrler 

RB^iuest ^S^IiiUji 

A FW CLA =FW 

A Type cut signed AC with P and Q 

B LOC Insect bceakfcint at LOC 

B Remove breakpoint 

C EP FN Ccmpare and tjpe discrepancies of subprogram 

EE and FN BSS. 

C EP C EP EP i.e., EP and FN are identical. 

D LOC FW Deposit = FH in LOC 

E FE FS Define symbol FS equal to expression FE 

F Set output mode to floating point 

F LvTC Set floating point and type C(LOC) 

F LOCI L0C2 Set flaating point and type C (LOCI thru L0C2) 

G LOC Go to LOC 

H Set output mode to Hollerith 

H LOC Set Hollerith and type C(LOC) 

H L3C1 L0C2 set Hollerith and type C(ICC1 thru LCC2) 

I Set output mode to decimal integer 

I LOC Set integer and type C(LCC) 

r LOCI LCC2 Set integer and type C (LOCI thru L0C2) 

J Set output mode to decrement integer 

J LOC Set decrement integer and type C (LOC) 

J LOCI LCC2 Set decrement integer and type C (LOC 1 thru L0C2) 

K FW CAL =FW 

K Type logical AC with S and Q. 

L EP Find and type origin of subprogram EP 

M Type storage map 

Set output mode to octal 

LOC Set octal and type C (LOC) 

LOCI L0C2 Set octal and type C(LCC1 thru L0C2) 

P Proceed (location in $IC) or interrupt 

after break 

Q Quit and return to CTSS 

S Set output to symbolic 

S LOC Set symbolic and type C (LCC) 

S LOCI LCC2 Set symbolic and type C(L0C1 thru L0C2) 

T FN Add symbols from FN SYMTB to symbol table 

(relocated by last origin typed out) 

X Remove all symbols from symbol table 

W BP FN L EP' I FN; work subpcograB EE with 

symbols from FN SYMTB 

w EP L EP* T EP: FN is identical to EP 



(END) 



QQ/~+ir>n JH ft n7 Oitno 



Identification 

MADBUG - a MAC Debugging System 
Robert S. Fabry 

Purpose 

MADBUG is a system under which the user can create and debug 
programs written in the HAD frogramming language- MADBDG 

allows tha user to input and edit symbolic programs and to 
execute in a controlled way and interrogate the derived 
machine language pLogcams. The most important consideration 
in tha design of HADEOG was ease in learning and using, both 
for the beginner and for the advanced programmer. MADBUG is 
unusual in that it utilizes information which has been 
previously ignored. This information comes from: (1) the 
saquanca in which the user types his requests, (2) the files 
available in the user's file directory, (3) the expanded 
information content of the new MAD symbol table files 
developed tor MADBUG, and (U) the information inherent in 
tha vary limited, stylized set of coding sequences generated 
by a comfiler. The use of this additional information 
manifests itself in two ways: (1) the user need provide very 
littla information to accomplish a given task, and (2) the 
user does not have to understand assembly languages, 

mi~hinr> languages, ictal numbers, relative or absolute 
addresses, symbol tables, machine representations of 
:::onstants, or any of a host of similar items. The MAEBUG 

requests of CHANGE, DELETE, INSERT, and APPEND demonstrate 
tha influence of the "Expensive Typewriter" program written 
for the EDE-1 by Steve Finer. The "DDT" program written for 
the PDP- 1 by Robert Saunders and the "FLIT" program written 
for tha TX-0 by Jack Dennis and Thomas stockham have 
influenced the OPEN, VERIFY, BREAK, and KILL requests. 

Raf arance 

CC-2U7 and Mac-M-205 MADBUG: A MAD DEBUGGING SYSTEM R.S. 
Fabry 



crss FPCGRAMMER»3 GUIDE Section AH. 8. 02 Page 2 



A EESCRIPTION OP MADBUG 

MADBUG is instructed by requests, typed one per line. a 

request line is made up cf the name of the request followed 
by its arguments, with one or more blanks for separation. 
Request names may be abbreviated by their first letter. In 
request lines, tabulation characters are equivalent to 
blanks. There may be blanks before the request name and 
aCtar the last arqumeat; blank request lines are ignored. 
Since blanks are used as delimiters, the arguments, which 
may ba as complicated as "a (1 ) ♦ 1 . . . b-3 " , must be typed 
without internal blanks. A request which operates on 

variables will operate on single variables or on blocks of 
viriablas, specified in the usual MAD manner as 
"alpha. . .beta" ; a request which operates on cards will 
oparata on single cards or on blocks of cards. For example, 
"verify alpha beta (1 ) . , .be ta ( 3) k( 1,1,1)" would verify, in a 
s^nss described later, the variables ALPHA, EETA(1), 
BETA (2), BETA (3), and K(1, 1, 1). 

MADBUG requests can be classified into four groups: the edit 
requests which are PSINl, DELETE, INSERT, CHAMGE, APPEND, 
MANIPULATE, and TRANSLATZ; the core requests which are GO, 
JPEN, VERIFY, LINKAGE, BREAK, KILL, SAVE, and RESTORE; the 
r-quasts for raturning to CTSS which are QUIT and EXECUTE; 
and the declarations which are WORK, USE, and FORCE. These 
raguests will be discussed in the next few sections, 

Tha Work Request : 

Tha MADBUG requests are carried out in the context of a 
single MAD subprogram. The DORK request allows the user to 
daclara which subpragram is of interest. For example: 

"work prog" sets up MADBUG to work on the program in file 
PROG MAD. The file PROG MAD does not have to exist. As 

illustrated in the sample session, if the user adds lines to 
a non-existant file, MADBUG will create the file. Thus, if 
tha usar is working in the context of a subprogram PROG, and 
wishes tc print a subprogram ROOT, hs must first request 
"work root" and then may request "print". 

Edit Requests: 

MADBUG uses a different technique for editing than the CTSS 
EDIT command. Neither the user nor MADBUG supplies a line 
number for a card image. Instead of indicating a card image 
by giving its associated line number, the user has three 
options: (1) the statement label on the card, if any; (2) 
the card's position relative to another card which has a 
statement label (the third card before ALPHA is ALPHA-3; and 
(3) the number cf the card in the deck (the 17th card in the 
iack is simply 17). In counting for (2) or (3), the user 
must count all physical card images including remark and 
continuation cards. MADBUG interprets the arguments of a 



cnrnp Qar-l-irin iH-R-O? P»a^ 



raquest before executing the request; thus, if a deck 
consisted of three cards, "delete 1 2" would leave the third 
card, but "delete 1« followed on another line by "delete 2" 
would leave the second card. 

In unusual situations there raa y be a long section of program 
with no staternent labels. The user is free to insert renark 
cards with statenent labels in such a case. M&DBUG, but not 
tha MAD translatDr, will allow references to statement 
labels on remark cards, 

Thraa special conventions exist for specifying statement 
labels: (1) the " *" is always taken to mean the previous 
::iri referred to by the user, so that a "print » + 3" after a 
"print 6" would print the 9th card, and so that a "print 
alpha *+2" would print three cards starting with ALPHA. 

(2) the "/" is always taken to mean the last card in the 
i33k, so that, in a five card program, "print 1 3 5" is 
identical to "print 1 3 /". (3) Requests which operate on 
= ards will operate on every card in the subprogram if no 
cards are specified, so that "print" is identical to "print 

1.../"- 

!^,4DBUfl observes the st^ndari conventions of horizontal 
spairinj: the characters after a tab will fce moved to ccluon 
12 and the characters after a tab-backspace will be moved to 
column 11. 

Tha description of several of the editing requests will 
refer to input line blocks. An input line block consists of 
all tha lines the user types before typing a blank line. 
The editing requests are defined as follows: 

PRINT will print all cards mentioned as arguments. 
Thus, "print a (1 ) ♦ 1 . . .b-3 " would print a block 
of cards starting with the card after the card 
labeled A(1) and ending with the third card 
before the card labeled B. 

DELETE will delete all cards mentioned as arguments. 

Thus, "delete" would delete all of the cards 

of the subprogram being worked, and "delete 1 

3. ..6" would delete the first and the third 
through sixth cards, 

INSERT will insert successive input line blocks 
before successive cards mentioned as 

arguments. Thus, one might see the following 
sequence ; 

u :print 

M:ONE 

M: 

U: insert 



CTSS PBCGBAMMER'5 GUIDE Section AH. 8.02 Page U 



U: 


zero 


U : 




U: 


print 


M: 


:ZERO 


n: 


;ONE 


M: 




U: 


linsert 


U: 


a 


U; 




U: 


b 


U : 




U: 


print 


M ; 


:A 


M: 


ZEBO 


M: 


a 



1 one 



M:ONE 
M: 

CHANGE will replace successive carfls or blocics of 
cards, given as arguments, fcy successive input 
line blocks. A block containing any number of 
cards may be replaced fcy an input line block 
of any length. 

APPEND with nc arguaents will append the input line 
block which follows the request line to the 
subprogram being worked. On the other hand, 
if the request has arguments, they are taken 
to refer to MAD subprograns which will be 
appended, in order, to the program being 
worked. 

APPEND is also aseful for creating a acdified 
version of a subprogram while keeping the 
original. To do this, WCBK the new name, 
APPEND the old name, and then make 
raodif ica ticns. 

MANIPULATE is d request fcr character manipulation within 
a card image. The first argument specifies 
the manipulation. Arguments after the first 
specify cards within which the manipulation 
will be performed. The first argument has the 
form: /♦♦♦/***/ where the slash stands fcr any 
separation or delimiter character which must 
occur exactly three times, and the strings of 
asterisks stand for any pair of character 
strings. The manipulation consists of 

replacing all occurances of the first string 
by the second string. Any character except a 
tab or space may fce used as the delimiter; it 
is recognized by its being the first character 
of the argument. The two character strings 
may include any characters except the 



rpQc: cnnnBAMMFB*^ ailTDE Section AH. 8. 02 Paqe 



delimiter and the carriage return, and they 
may be of different lengths. If the first 

string is empty, it will be taken to match a 
null string before column one on the card, 
thus allowing a simple May of inserting a 
statement label on a card. As a confirmation 
to the user, MADBUG will print a list of cards 
on which the manipulation is performed. If 

the ntanipula ticn is performed more than once 
on a card, the card will be included in the 
list once for each time the manipulation 
occurs. MADBUG does not consider replacing a 
string by itself to change the symbolic 
program. Ihus the user can replace a string 
by itself to locate all occurences of the 
string. 

TRANSLATE has no arguments, and causes the subprogram 
being wacked to be translated into machine 
language by the MAD compiler. From the user's 
point of view MADBUG is performing the 
translation. It is not necessary to translate 
any subprogram before using it. MADBUG will 
request any translations that are needed at 
load time. The TRANS lATE request is a 

convenience to the user who is changing 
several subprograms at one time, and who would 
like to catch any syntactic errors in one 
before turning his thoughts to another. 

Th9 Use Bequest: 

The core requests, which will be discussed in the next 
saction, operate in the context of a core image. MADBUG 

must have soroe way of knowing what subprograms to load when 
creating a core image. The arguments of the USE request are 
the subpcogcams to be used. Thus a user writing a 

subroutine BOOT and a test program MAIS might "use main 
toot". There are previsions for using FAP programs, special 
libraries, and special loader parameters; these provisions 
are described later. 

Core Image Requests: 

Some core requests require cards for arguments, and their 
arguments observe the same conventions as those of the edit 
requests. A core request which refers to a declaration or 
remark card will operate on the first executable statement 
following the referenced card. Other core requests require 
variables for arguments. A variable is given as an argument 
in standard MAD natation, including multi-dimensional arrays 
and COMMON and ERASABLE variables, but not the dummy 
arguments of functions. Three special conventions exist 
for variables: (1) the ***" is always taken to mean the 



CTSS FFCGeAMMER»S GUICE Section AH. 8. 02 Page 6 

pravious variable refered to by the user; (2) if no 
variables are specified, the request will operate on every 
variable in the program; and (3) the block notation can be 
used to include several arrays or variables at once. 
Variables are taken to be ordered alphabetically (with a 
blank coning after R, alas.) and then by linear subscript. 

Th3 first time the user gives a core request, a core image 
must be created by MADBUG. This is accomplished by 

translating each of the needed subprograms into machine 
language, if necessary, loading the subprograms into core, 
and finally modifying some of the subprograms in order to 
intercept illegal references to an array. If an error is 
iatactad in this pracess, the core image will not be formed, 
and the core request will be terminated. The user should 
correct the error and try the core request again. The core 
image will be destroyed when the user issues the quit 
request or edits a program occuring in the core image. The 
zor^ requests are defined as follows: 

GO will start the user program. A single card 
given as an argument for GO will cause the 
user program to be started at the named card. 
If no argunent is given, the user program will 
be started wherever it stopped last. A fresh 
core image will start at the beginning of the 
main program. 

The user program will remain in control until 
(1) it terminates by calling DEAD, DORMNI, 
RNDJOB, ERROR, or EXIT; (EXIT can be 
implicitly called by letting control reach an 
END OF PROGRAM or END OF FUHCTIOH card.) (2) 

a »*breakpoint" is encountered by the user 
prcgran; (3) the user interrupts by pushing 
the break button once; or (4) an array is 
referenced with subscripts pointing outside of 
the dimensioned array. (Some array dimension 
violatians ate not caught; this is discussed 
in a later section.) Cn any of these 

occasions, control returns to MADBUG, and the 
user is informed of the reason. 

Infrequently, the user program may have an 
error which causes control to retura to CTSS. 
In this case, the user should type two CTSS 
commands, first "save (user)" to save his own 
core image and second "resume (mdbg)" to 
return control to the core image on which 
MAEBUG saved itself. Even if the first of 
these commands results in an error comment 
from CISS, the user should type the second. 
This procedure is called a manual restart. 



J KZ^\, XKJll 



r<iye 



CPEN will print the contents of variables mentioned 
as arguments, one by one, and after each, wait 
for the user to type a new value for the 
variable. If the user wishes the old value to 
regain, he just types a carriage return. In 

typing aut the value of a variable, MADBUG 
makes use of the declared mode of the variable 
and 3f the current value to decide whether the 
value should be presented to the user in 
integer, alphatetic, floating-point, Ecolean, 
statement label, or function mode. The user 
must type a constant for the new values in a 
form ccmpatible with the declared mode of the 
variable. It is possible to change the 

input/output form associated with a declared 
mode permanently or to override the normal 
associations for a single request. This is 

discussed later. 

One special note: because of the way the MAD 
compiler works, one may change the effect of a 
transfer statement by changing the value the 
Variable which has the same name as the 
statefRent lafcel to which the statement 
transfers. One may not, however, change the 
scope of a rHROUGR loop in this fashion, even 
by changing the value of the variable with the 
same name as the THfiOOGH scope. 

VEBIFY will cause the values of variables mentioned 
as arguments tc be compared with the values of 
the same variables in a fresh, unexecuted 
version of core. Each variable whose value 
has changed will be printed with its present 
value. Its value in the fresh version of core 
will also be printed if it is non-zero. 

An option is available with verify; the user 
may specify any core image saved with the SAVE 
request to be used instead of the fresh copy 
of core discussed above. This is done by 

giving the name of the saved image following 
the rejuest name and before the list of 
variables to be verified. As the user will 
discover below, this name must begin with an 
asterisk, and can thus be recognized by 
HADBUG. 

The discussion of output forms used for the 
values of variables, which was given under the 
OPEN request, also holds for the VERIFY 
request. 



CTSS PROGKAMMER'S 3IiIDE Section AH. 8.02 Page 8 

LINKAGE causes MADBUr, to tell the user which statement 
made the most recent call to the external 
function subprogram currently being worked. 

BBEAK will modify the aachine language program in 
the current user core image so that control 
will return to HADBUG if one of the cards 
given as arguments is to be executed. When 

MAEBUG regains control from the user prograis, 
the name of the statement which is about to be 
executed will be printed for the user- At 

this time the user will usually examine 
variables in his program to determine what his 
program is doing. "Breakpoints", as these 

points in the user core are called, belong to 
A given core image, and can vary from one 
saved core image to another. (See the SAVE 
request. ) 

KILL will renove any breakpoints at cards mentioned 
as arguments. It is not an error to insert a 
breakpoint where one already exists nor to 
remave Dne which does not exist. For example, 
to kill all the breakpoints in the subprogram 
being warked, "kill", 

SAVE has a single name as its argument and causes a 
copy of the current user core image to be 
saved as a CTSS file with the primary name 
given as an argument and the secondary name 
SAVED. The name given by the user must begin 
with an asterisk. The current user core image 
was produced by loading, and has been modified 
by execution and by HADBUG requests. One may 
save the current core image under a name which 
has already been used for a save request. In 
this case, the current core image will replace 
the previous core image- All the core images 
saved using the SAVE request will be destroyed 
when the user's current core image is 
destroyed. This is because the saved files 
created by MADBUG are not normal CTSS saved 
files, and are useless out of the context of 
MADBUG. 

RESTORE will replace the current user core image with 
a CDpy 3f the image whose name is given as an 
argument. The core image nams must be a name 
under which the user has saved a core image 
using the SAVE request, or it must be ♦FRESH, 
♦FRRSH is a byproduct of the loading process. 
It is a completely unexecuted version of core 
with no breakpoints and with all variables at 
their initial values. Except for the special 



- nTnu ca/-.*- i i->T> &n H n ") Pario 

way in which it is created, *FBESH is like any 
n3rinal core image saved by the SAVE request. 

Getting Back to CTSS: 

When the user is finished with MADBOG, and desires tc return 
to CTSS, he should use the QUIT request. The CUir request 
willdsstroy all the files created during the session, 
except for the modified MAD programs and their associated 
BSS and SYMTAE files. 

Tha EXECUTE request allows the user to return to CTSS for a 
single ccBiraand, without ending his session with MADEUG. For 
axainple, the user could effect the CTSS coonand "listf aa 
mad" by requesting "execute listf aa mad". These conimands 
are executed using the cctnmand chaining technique with the 
saquenca: "save (mdbg) ", the user's coBBand, and "resume 
(nidbg)". No provisicn is made for saving a core image which 
might result from the user's command. 



CTSS PROGRAMMER'S GUIDE Section AH. 8. 02 Page 10 



SPSCIALIZED FEAIDRES AND TECHNIQUES 

Two error coments that the user mdy get from MADBUG have 
special sigai ficance. One is "THY AGAIB.", which always 
niians that the current request has been terminated. The 

other is "CONSULT LISTINGS." which can only occur as a 
result of a bug in MADEUG, Any user getting this coBment 
will please retain as much information in the way of output, 
filas, ate. as he can and call Bob Fabry, x252U, so the bug 
can be removed promptly. The user can often continue with 
mora r3:juests in spite of a "CONSULT LISTINGS." error. 

Two types of iaproper array references are not caught. 
First, references with a constant linear subscript are not 
checked. For example, one might DIffENSIGN A (10) and 

A(20)=100. Second, references to arrays which are given as 
aryuaents to functions are not checked. For exanple, one 
could have called for ROOT. (A(K)) where K is 20. This 

situation can scBetirees be avoided by placing arrays in 
COMMCN, and not passing theiB back and forth as arguments. 

In unusual casas, the user core image may "blow-up" in such 
a way that the information about control and about the 
vilues of variables is gone or meaningless. In this case 
the user will still find MACBUG a useful tool, and may 
approach the problem by an exponential search through time 
for tha point at which the blow-up occurs. Stated another 
way, this amcunts to performing a series of tests in which 
aich tast is designed to cut by a half the uncertainty about 
when the blow-up occurs. When the user knows the exact 
point of the blow-up, he can then step through very 
cautiously, looking for clues. Such an approach relies 

haavily on BREAK, KILL, SAVE and RESTORE. At the start, the 
usai moves a core inage as close to the tlow-up as he knows 
he can, SAVEs the core image, and guesses the half-way mark, 
in terms of opportunities for bugs, to a place by which the 
blow-up irust have occured. He then uses BREAK and KILL to 
stap his current core image to the half-way point he 
guessed. (1) If the core image blows-up in this process, he 
guassas a new half-way point, half way fcetween his saved 
image and his old half-way mark, RESTORES his saved core 
image, and trys his new guess. (2) If the core image 

doesn't blow-up in the process, he SAVEs his current core 
image for a new starting point, guesses a new half-way mark 
batwaan his new core image and the blow-up, and trys this 
new guess. This process is fairly simple to carry out using 
MADBUG, and most bl3w-ups can be readily solved this way. 

Whan loading is performed, MADBUG will normally load a 
program named (MDB3) , which MADBUG provides, immediately 
following the files specified by the USE request. Then 

MADBUG will process the core images of all programs loaded 
into core before (MDBS) and insert patches, using an area 
rssarvad in (HDEG) , to attempt to catch any user subprogram 



when it accesses an array with an illegal subscript. If the 
ussr wishes to load pcograas which were written in FAP, MAD 
programs for which the symbolic programs are not available, 
i3buggsd MAD programs which he does not wish to protect, or 
library files, he may specify the position of (MtBG) by 
typing (KDEG) in place of a file name in the USE request. 
All the files before this parameter win he treated 
normally, and all things after it will be ignored by BACBUG 
and just passed on to the loader. Any loader parameters, 
such as (CFLP) or (LIBE) , can also be used after (MDEG). If 
tha user needs more than eighty characters for his USB 
request, he itay type a hypen as an argument of use, Hhen 
tha hyphen is encauntered, MADBUG will iniBediately read the 
next input line for lore arguments for the USE request. 
This may be done for several successive lines. 

Tha FORCE request forces certain internal registers in 
MADBUG to new values, picked by the user. To FORCE a 
parametar, give the name of the parameter as the first 
argument of FORCE, and give remaining arguments as required 
by the parameter being forced: 

FORCE PATCH will set the amount of patch space 
available in the user core images to the 
decimal number given as the argument. 
Initially PATCH is set to 500. The patch 
space is used during loading and whenever 
breakpoints are inserted. FORCE PATCH does 
not change the available patch space 
iaoediately, since the internal register is 
examined only during loading. A user would 
reduce the patch space if he was squeezed for 
core space. He would increase it if MADBDG 
conplains, during loading, that there is not 
enough patch space, or if he exhausted the 
patch space inserting breakpoints. If the 
patch space is exhausted by breakpoints, 
however, it is usually sufficient to KILL soiae 
of the less neccessary breakpoints to get 
space f3r new ones. 

FORCE FOEWAI will set the normal input/output form 
associated with each of the possible modes for 
variables. After the word FORMAT, the 
arguments are taken in pairs, the first item 
of the pair indicates a mode and the second 
indicates a form. The modes are indicated by 
a digit from to 7, standing for 
floating-point, integer. Boolean, function, 
statement label, mode 5, node 6, and aode 7, 
in that order. The form designation is one of 
the following: "Gn" for floating point with n 
significant figures on output, "i« for 
integer, "A" for alphabetic, "P" for either 



CTSS EPCGBAMMER'3 GUICE Section AH. 8. 02 Pdge 12 



integer or alphabetic with MADBUG picking for 
output, "p"* for octal, "B" for Boolean, "S" 
for stateaent label, and ••F" for function. 
Initially, PORMT is set to: G3 1 P 2 E 3 F 
4S5p6p7j>. {In this section, "fiJ" is 
used to denote the letter "0".) 

FCP.CE HOLE alows the usee to predetermine whether 
MADBUS saves itself as a permanant mode file 
or as a temporary mode file. The values of 
MODE are, correspondingly, "P" and "T", Hode 
is Driginally set to "P", The user will want 
to FORCE MODE to temporary if he is not 
interested in extreme reliability as much as 
in conserving his track allotment. 

It is also possible to override all the normal I/O forms for 
the duration of one OPEN or VERIFY request. To do this, use 
ona of the form designations listed above, but preceded by a 
slash. Insert it after VERIFY (and the saved file name, if 
present) or CPEN and before the arguments. For example, 

"open /o alpha" . 

MADBUG observes the convention that the first statement of a 
main program starts after the call to .SETUP which the 
compiler always inserts as the first executable machine 
instruction. Another convention at this level is imposed by 
tha compiler. A breakpoint on an ENTRY TO statement will 
not be encountered when the entry is called, but will be 
ancountared if control is transfered to the statenent or 
falls to the statement. 

MADBUG creates and destroys special files as it processes 
tha user's requests. They are destroyed during the 

processing of the same request for which thsy are created. 
Normally, the user will not have to worry about them, but 
occasionally he may be made aware of their existance. 
(MDBG) SAVED is the name under which MAEBDG saves itself 
whan it chains to other commands. This file will vary in 
length during a session, but will be on the order of 30 
tracks long. Its mode depends on the value of MODE, as 
described earlier. (lEMP) (MDBG) is used during file 

modification. When a word in a file must be modified, the 
modified file is first created as (TEMP) (MDBG) , and then 
tha original file is deleted and (TEMP) (RDBG) is renamed. 
Tha length of this file depends on the length of the file 
being modified. The file has permanent mode. (MDBG) ESS is 
craatad by MADEUG whenever loading is required. Its 

position in the new core image was discussed earlier. It 

contains the bootstrap for MADBUG and the patch area. It is 
one track Icrg and has temporary mode. (KBGI) SAVEE is a 
V3ry short progran which processes the input line blocks the 
user types while editing. It processes all tha input line 
blocks dssociatGd with one edit request and reads in the 



urn 17 Ctif^ 4-1 rtn BH Hfi:> PflClA 11 

following request before chaining back to MADBOG. It is 
usually one track long and is permanent incda. 

A user core image may use the command buffers. A call to 
CHNCOa will not return control to MADBUG- MADBUG saves the 
command buffers and counter initially and restores them when 
♦-wg .jsar gives the QUIT request, MADBUG also treats the 
command buffers and counter as psuedo-machine conditions 
associated with each core image. The buffers are only lost 
on manual restart. A fresh core image has empty buffers. 

By editing, the user modifies the MAD subprogram on which he 
is working. By inserting and removing breakpoints and by 
changing the values of variables, the user modifies the 
current user core image, (USEB) SAVED. MADBUG does not 
"hang^" external files until the changes are logically 
needed. If the user uses EXECUTE to ask CTSS to process 
thase files, he aay want to insure that these logical 
modifications are made fhysically. To insure that the MAD 
subprogram being wDrked is modified physically, give a 
redundant WCBK request using the name of the subprogram 
already being worked. Whenever a WCBK request is given, the 
logical modifications associated with the subprogram 
previously being worked are mads physically. To insure that 
tha current user core image is modified physically, use a 
SAVE request. A user who cannot afford the added tracks can 
giv3 an "execute delete" on the created SAVED file. This 
variation between the physical and logical modifications 
provides some degree Df safety to the user who carelessly 
makes gross incorrect modifications to one of his programs. 
If the user should accidently type a "d" as a request line 
for example, he should quit by hitting the break button 
twice in succession. This will prevent KADBUG from actually 
daleting the file in juestion. 



CTSS PHOGRAMHEB 'S 3 DIDE Section AH. 8. 02 Page 1U 

SUMMARY OF MADBU3 REQUESTS 

E^aii^si SIiJiJJ§£is ad iitional. lines (3) 

work subpCDgcaiD name none 

print card names (1) card inages by HADBOG 

delete card names (1) none 

insert card names (1) card images by user 

::hang3 card names (1) card images by user 

appani none card inages by user 

(or) subprogram names none 

manipulata special, then cards card names by MADBUG 

translate none comments by MADBUG 

use subprogram names none 

go card name or none comments by MADBOG (U) 

opan variables (1,2) values by both (U) 

varify variables (1,2,5) values by MADBOG (U) 

linkaga none linkage by MADBUG (tt) 

break card names (1) none ( U) 

kill card names (1) none ( «) 

save save- name none (1) 

restore save- name none (4) 

quit none none 

execute command and arguments depends on command 

force paraieter, special none 



notes: (1) If none, all are implied. 

(2) Optional torm forcing first argument. 

(3) Any request can get error comments from MADBUG. 

(4) Comments by KADBUG if core image is created. 

(5) There is an optional save-name argument. 



(END 



CTSS JPCGSAMM EB*3 GUIDE Section AH. 8. 03 9 '55 1 



liiHtif ication 

Post Moctam Debugging 
vn 

Purpose 

Produce post-mortem information about the user's last 
dormant program (loaded by the relocatable program loader). 

Ess i £ i c t i o n s 

Tha program should be loaded by LOAD or LCADGC so that the 
loader and ircvie table are available. 

Usaje 

Tha FM command may be followed by one of several requests. 

PH 'lie. • Gives the stop location or ILC (1 line). 

PH 'LIGHTS* Gives machine conditions and ILC (4 lines). 

PM 'TRAFS.' Gives contents of trap location (1 line) 

PM 'STOP* Gives ILC and contents of two locations on 
either side of the stop (5 lines) 

PH 'AUro» Corresponds to LIGHTS plus STOP (9 lines.) 

PM 'STOBAE* Gives origin and entry of all subprograms 
loaded . 

PM NAME 'STOMAP' 3ives the origin and entry of all 
subprograms loaded beginning with SAME. 

PM NAiiE Gives GDntents of four initial locations of 
subprogram NAME (5 lines). 

PM NAME LOCI LCC2 -MODI- -CIBECTION- 

Gives contents of all locations from relative 
location LOCI through L0C2 of subprogram NAME 
in the specified mode and direction. NAME is 
•(WAIN)' for the aain program. L3C is assumed 
to be decimal; if the number is preceded by a 
slash, •/', it is taken as octal. MODE 
specifies the form of printed output and may 
be 'FIX', 'FLiJ*, 'DEC, 'iZCT', 'BCD', or 
•ALL*. DIRECTION specifies the order of 
printing and may be 'FWD* or 'REV. If MODE is 
ommitted 'ALL' is assumed; if DIBECTICN is 
omitted, 'FWD' is assumed. LOCI and L0C2 may 
be replaced by 'ENTIRE* to cause printing of 
the entire program. 



CrsS PHOGHAMMER»S GUIDE Section AH. 8. 03 9/65 



PM LOCI L0C2 -MODE- -EIRECIION- 

Gives the contents of absolute locations LOCI 
thru L0C2. 

References to COMMON must be the high core 
locatioas which appear in the assembly 
listing, net the lower core area actually used 
for COMMON. (Caution: illegal requests, 
either outside the program range or improper 
requests for COHMON, cannot be interpreted 
correctly. ) 



(END) 



rr^'^ PRrnBAMMKB»=? RnTTF Section AH.a.Oa 9/65 1 



I^SSm icaticn 

Ralocatable program patching 
PATCH, STOPAT, TEA 

Purpose 

To allow break points to be set in a progran after it has 
been loaded, to allow transfer of control to a specified 
location, and to allow modification of the loaded program. 

These service routines are ncrnially loaded after the program 
is loaded and so the loader must te available in core. 
Therefore LOAD or LOADGO should be used for loading the 
program . 

Usage 

Sat a break point: 

SrOPAI ENTRy RELLOC 

BMTHY is an entry point in the desired subprcgraro. 
If ENTRY is omitted, the main program is 
assumed. 

RELLOC is the relative octal location in the 

specified subprogram at which the break point 
step is to occur, 

STOPAT replaces the instruction at RELLOC with a 
transfer, Hhen the transfer is executed, the 
original contents of RELLOC is restored and 
the program is placed in dormant status. The 
START coBHiand may then be used to continue 
with the execution of the original contents of 
RELLOC. 



Transfer: 



IRA ESTHI RELLOC 

Same arguaent specifications as STOPIT. The 
issuance of the START command will cause a 
transfer to RELLOC. This may be used to 
restart the program from different locations 
during debugging sessions. 



Modify the program: 

PATCH AHG 



CTSS FBCGBAMMER»5 GUIDE Section AH. 8.04 9/65 



ARa = entry: ARG laay be the entry point of a subprogram 
which is to be patched by referring to 
relative locations within the subprogram. If 
ARG is omitted, (MAIN) is assumed. 

ABG=' (ABS)' allows patches to absolute locations, 

ARG=' (COH)' allows patches to relative locations within 
the COMMON region. 

ARG='(PAT) ' allows patches to be entered into locations 
above the user's current nemory bound. This 
patch space is referenced by relative 
locations and is shared by all subprograas. 

After a response from the PATCH coiBniand, the 
user enters lines of the form: 

LOC, TYPE, VALUE, HELOC 

LOC is the octal address to be patched. This octal 
number may te immediately followed by a 
special letter if it is desirable to override 
ARG for this response. The special letter may 
be A fcr absolute location, C for relative 
location in common, or E for a relative 
location in the patch space. 

TYPE is the type of value to follow i.e., 

•OCT', octal word (used for instructions) 
•FLO', fixed or floating-point number 

(E or F notation) 
•INT', fortran integer 
•DEC ', MAD integer 

VALUE is the number to be patched into LOC. 

RELCC is the relocation specification for VALUE if 
TYPE is 'OCT'. It consists of two letters, the 
first fDr the decrement and the second for 
A: absolute 
R: relocatable 
C: common 
P: Patch space 

If RELOC is omitted, AR is assumed. Successive 
VALUES and appropriate RELOCs may be specified 
in any line. 
Exit fr^m PAICR by typing 'EMD^. 



(END) 



au tt n t; Parro 



Identificaticn 

Absolute ptcgrani patching 
SPATCH 

Puciiosa 

Programs leaded with LDABS, NCLOAD, or VICAD may be patched 
using some supervisor routines which do not require specxal 
loading and Hiovie tables. This is accomplished by patching 
thair SAVED file, rather than the core B program directly. 

ysa3.e 

SPATCH KAME1 LOG A1 B1 A3 B2 . . . An Bn 
SPATCH NAnE2 ILC L 

SPATCH patches the file NAME! SAVED beginning at 
absolute octal location LOC for n locations. 
If LOC is 'ILC', only the IIC of SAME1 SAVED 
will be patched, causing a transfer of control 
to absolute locition L when NAME1 is BESUKED- 

Ai 3i are the octal left and right half words 
respectively . 

L is the location at which control should be 
BESOMED. 



(END) 






Supervisor debugging 
SD, SF 

Pur£ose 

To allow for printing and patching the supervisor (core A). 

UsaiB 

The printing routine has several options: 

SD ENTRY RE LOG N 

N consecutive locations starting at relative 
octal location RELOC in subprograa ESTRY in 
the supervisor will be typed on the user's 
console in unrelocated (i.e., relative) octal 
with operation code mnemonics. If N is 
omitted, it is assumed to be 1. If EHTHY is 
omitted, the request is taken to be absolute. 
Lines cf zero are not supressed. 

SD ENTRY • TRACE* 

The name of the calling subprogram and the 
relative location from which subprograc ENTRY 
was last called will be printed on the user's 
console. The user m^y continue tracing back by 
typing a carriage return. The trace may be 
terminated by the QUIT signal. 

SD 'STOMAP' 

A storage map of all subprograms loaded into 
the supervisor's core (3ore A) will be 
printed. 

SD ENTRY 

The contents of the specified entry will be 
printed on the user's console in appropriate 
form (BCD for LDNAHE, all others in 5 octal 
digits) . 

Patching: 

SP ENTRY RELOC Al Bl CI A2 B2 C2 ... AN BN CN 

Patching will begin in relative octal location 
RELOC within the subprogram ENTRY. AI BI are 
the relocatable octal left and right 
half-wocds, respectively. The Ci contain two 



CTSS PROGRAMMER'S GUIDE 



Section AH-8.06 



Page 



characters indicating how the left and right 
half-words are to ha relocated. The characters 
may be A for absolute or R for relocatable. If 
a Ci is OuSiitted, it is assutaed to be AH. If 
ENTRY and Ci are omitted, the patching is 
absolute. 



(ESD) 



^mr-c^ nf^rhr^DK MMPD • Q nnTHF faction AH. 8-07 Page 1 

I^entificaticn 

STRACE - A trace debugging routine 
B. L. Wolnan 

Pargosa 

STBACB (Subroutine TRACE) is a debugging prograi which 
allows the user to monitor the calls of selected 
subroutines. A sat of conditions may be specified for each 
Subroutine tc be traced. At each call of the subroutine 
STHACE chaclts to see if all the conditions are met. If they 
are, STRACE prints a message identifying the s»^bpro9ram 
billed, how many times it has been called, the absolute 
location of the call, the program in «^^^J. ^^^^^^^^^ 
occurred, and the relative location withm the program 

maicing the call. 

Th- usar may request STRACE to STCI execution beffiJES 
executing a subroutine or to HALT after the subroutine has 
been called. If either cf these options are used, STRACE 
will print an identifying message before going to dormant 
status. PM cr OCTLK may be used to inspect the machine 
coniitions. Issuing the START command will cause execution 
to continue. 

The user may also specify a debugging subroutine which is to 
b- called before executing a subroutine. This debugging 

subroutine may perform any function the user desires; the 
call issued by SKIACE is of the form 

DEBUG (LOG, ARG) 

whare DEBUG is the debugging subroutine name, LOC is the 
location of the call to the subroutine being traced, and AR- 
is a parameter previously specified by the user. 

Options are also available which allow the user to obtain 
octal snapshot dumps of the machine registers, the 
subroutine calling sequence, and the value returned by the 
subroutine in the accumulator. 

Usa^e 

STRACE may be entered by issuing the CTSS command STRACE. 
B-causa of the method of implementation, the loader Bust be 
present in lemory. The STRACE command may be issued 
immadiately after loading, after a QUIT signal, or after a 
trace stop. (In general, STRACE may be entered any tiae the 
us-r's program is in dormant status). At the end of the 
input phase, STRACE will return to dormant in such a manner 
that tha START command will cause execution to be resumed at 
the point where it was interrupted. 



CTSS EPCGBAMMEB'S GUIDE Section AH. 8. 07 Page 2 

TRACE is an altecnate entry which oiay be called as a 
subroutine. In this case, TRACE returns to 1,U in the 
calling sequence. The calls are of the following fora 

AED TRACE () $ , 

BAD EXECUTE TRACE. 

FORTRAN CALL TRACE 

FAE rSX $TRACE, 4 

Whan STBACE is ready for input or more input, it prints the 
word TYPE, and waits. After receiving this response, the 
ussr may enter a series of cominands. Each coBmand consists 
of a subroutine name followed by one or more requests. 
Within a command, blanks are used to separate requests and 
their parameters. Since a carriage return is coapletely 
equivalent to a blank, commands may be split across one or 
mora lines of input. Each command is terminated by a coiima. 
The last comnand is terninated by an asterisk which 
signifies the end of the input phase. 

The following requests are currently recognized by STBACE (N 
and B are positive decimal integers less than 32768, EEBOG 
is the name of a subroutine) . 

AFTER N - Begin tracing after the Mth call of the 
subroutine. 

EVEBY N - Trace every Hth call- N should be 

ncn- zero. 

UMTIL M - Trace until the Nth call. The AFTER 

condition should be less than the UNTIL 
condition. 

STCP N - Go to dormant before every Nth call. If 
N is zero, the STOP condition will be 
removed . 

HALT N - 5c tc dormant after every Nth call. 
Execution will be interrupted after the 
specified subroutine has teen executed and 
before it has returned to the program making 
the call. This request should not be used if 
the subroutine being traced has an error 
return or does not always return to the same 
point in the calling sequence. If N is zero, 
the HALT condition will be removed. 

ARCS N - Every N times it is called, print the 
arguments of the subroutine. Each word in 
the calling sequence is assumed to specify a 
single variable. The absolute and relative 
addresses of these variables and their 
contents will Le printed in octal. The 



r-Tcc DorifiB » MMRB I c; riTtrnF «;3rrt-ion AH. 8- 07 Paae 



relative location will be "♦♦♦♦•• whenever the 
specified location is in CCBMON or is in turn 
an argument of the subroutine making the 
call. Whenever N is zero, the ABGS condition 
will be removed. 

VALUE N - Print the value of the specified 
subroutine. The value of the subroutine will 
be obtained by interrupting execution in the 
same Banner as the HALT request; the same 
restriction applies. The VALUE condition 

will be removed whenever N is zero. 

EM N W1 W2 ... Wn - Every N tines the specified 
subroutine is called, print an octal snapshot 
dump of the machine registers specified by 
the parameters W1 to Bn. The Wi 's may be any 
of the following words. 

AC Accumulator, Q and P bits 

MQ Hultiplier-quotient register 

SI Sense indicators 

MB Memory bound 

XI Index register 1 

X2 Index register 2 

X3 Index register 3 

X4 Index register 4 

X5 Index register 5 

X6 Index register 6 

X7 Index register 7 

LI First location in subroutine calling sequence 

L2 Second location in calling sequence 

L3 Third location in calling sequence 

CI First argument of subroutine 

C2 Second argument of subroutine 

C3 Third argunent of subroutine 

XS Equivalent to the sequence XI X2 X3 XU X5 X6 X7 

ALL Equivalent to the sequence AC MQ SI MB XS 

IE any of the above wards appears with an initial ainus sign 
in the request, the PM of the corresponding register (s) will 
bi removed. Because the PM request has a variable number of 
parameters, it must be the last request of any command. The 
PM print occurs after any call of a debugging subroutine and 
before any stop. The request PM will suspend all PM 
requests for the particular subroutine. 

CALL N DEBU3 M - Before every Nth call, execute 
the debugging subroutine DEBUG with parameter 
M. If H is zero, the CALL condition will be 
removed; in this case the debugging 
subroutine name and the parameter M should 
not appear. If M is zero, the parameter used 
in the call of DEBUG will be the number of "^ 



CTSS EPCGRAMMEH'3 GUIDE Section AH. 8. 07 Page U 

times the subroutine being traced has been 
executed. If both the STOP condition and the 
CALL CDndition are simultaneously satisfied, 
the CALL cf the debugging subroutine will 
occur before the STOP. 

COUNT N - Reset the execution count of the 
subroutine to H. This request may be used to 
continue tracing after the UNTIL limit has 
been reached. 

REMOVE - Resove the subroutine from the internal 

trace table. After this request has been 

given, STRACB will have no record of or 

ccntrcl over calls to the subroutine. 

OFF - Turn off tracing of this subroutine. All 
succeeding calls will be ignored until 
tracing is restored via the ON request. 

ON - Restore tracing of this subroutine- 

FIHD - Print the entry point of the subroutine. 
Any requests after the FIND will be ignored. 
FIND should only te used if no tracing is 
desired, since entry points are automatically 
printed the first time a subroutine name is 
encountered during the input phase. 

It no request is given following the subroutine name, the 
standard requests 

AFTER EVERY 1 UNTIL 32767 STOP 
CALL HALT ARCS VALUE PM 

are assumed. Any requests given by the user override the 
corresponding standard value. Any of the tracing parameters 
of a subroutine may be changed by the user in a later entry 
to STRACE. 

Method 

Whan STRACE is asked to trace a subroutine, it saves the 
name of the subroutine in an internal table. STRACE 

saarchas the MOVIE) table for the named subroutine. If it 
is found, STRACE obtains the entry point. STRACE then uses 
ths MOVIE) table to find the origins of all programs in 
zotB. Whan it finds a program that has a transfer vector, 
it searches this transfer vector for a TTB to the subroutine 
antry point. If a TTR is found, it is changed to a TXL 
TRAP,, TABLE where TRAP is the address of the trace 
processing sectioa of STRACE and TABLE is the index of the 
subroutine being traced in the internal trace table. 



t:i:rtr:D&MMirR«^ nriTnP Section AH. 8-07 Paqe 



Tha REMOVE request causes essentially the inverse operation 
to be performed. All rxL TRAP,, TABLE instructions are 

3tiangad to ITR ENTRY and the subroutine is removed from the 
internal table. 

During execution of the user's program a call to a traced 
subroutine will result in a TSX to the IXL instruction in 
tha transfer vectar. The TXL instruction will transfer to 
the appropriate section cf SIRACE. Using the contents of 
iniax register 4, SIRACE obtains the TXL instruction and 
checks to see if it is legal (i.e., does the table position 
indicated by the decrement actually correspond to a 
subroutine name?). If the TXL is legal, STRACE retrieves 
th3 tracing conditians for this subroutine and checks them. 
Depending on the conditions and the number of executions of 
th2 subroutine, STRACE may print the trace massage before 
transferring to the subroutine. 

Whan tha HALT or VALUE requests have been specified, STRA3E 
examines the subroutine calling sequence to determine where 
tha subroutine will return. It then saves the instruction 
at the return point and the instruction immediately 
following in the trace table and replaces them with a 
transfer back to STRACE. When STRACE obtains control 

following the execution cf the subroutine it restores the 
two instructions. If the subroutine does not return 

correctly the breakpoint will not be removed and the two 
instructions which were saved will te destroyed the next 
time the HALT or VALUE ccndition(s) are satisfied. 

The call of the debugging subroutine and tha execution stop 
orcur just before the transfer to the traced subroutine. In 
both cases the user's machine conditions (with the exception 
ot index register 4) are restored. 

S.^ S t ri c ti_o n s 

Only 20 subroutines may be traced at one time. This limit 
is somewhat arbitrary and may be increased in the future. 

STRACE will correctly handle any subroutine that is called 
by an instruction of the form TSX SUB, U- A subroutine such 
as (lOH) which is entered by the instruction IRA* (lOH) 
::annot be traced. A subroutine should not be traced if 
thare~is an^ indirect reference to it through the transfer 
vactor . 

ERROR MESS AGES 

The following error messages are currently implemented 

TRACE TABLE FULL - No more subroutines can be traced 
until the REMOVE request is used. 



CTSS FFCGBAMMEB'3 GUIDE Section AH. 8. 07 Page 6 

NAME IS NQr IN TRACE TABLE - The user has attempted to 
use the ON, OFF, ot SEMOVE requests for subroutine NAME 
whi=h is not in the internal trace table. 

NAME IS NOT USEE - Subroutine NAME has been loaded but 
is not called by any prcgram. All requests for this 

subroutine are ignored. 

NAME IS NOl IN MOVIE TABLE - Subroutine NAME has not 
baan loaded. All requests pertaining to this subroutine 
will be ignored. 

NAME IS NOT A HEaUEST - STRACE does not recognize the 
rsguast HAKE. This ward and the next word of input (nest 
requests have a paraneter) will be ignored, if the coniBand 
lins saams to be fauled up, the user =an recover by typing a 
comma to terminate the ccamand and then retype the entire 
command. 

NAME PABAMEIER HISSING, REQUEST IGNCEED. - The user has 
typad a sequence such as AFTER, or UNTIL,. The parameter 

for the request NAME is missing, since the comiand was 
tarminated by the cDmma, the user must enter another 
command. Note that the command 

SIN AFTER UNTIL 2 , 

will result in the comment 2 IS NOT A RECUEST. 

BAD CALL OF TRACE FROM IOC - There has been a spurious 

transfer into STPACE ot else location LOG ( the word pointed 

to by the instruction at 0,U ) contains a TXL instruction 

wtiich has an illegal decrement. The decrement of a legal 

TXL instruction should be less than 201 (for the current 

limit of 20 entries) a nd a Bultipie of 10. The user's 

machina conditions will be restored, and STRACE will go to 
dormant. 

SAME IS NOT A LE3AL PM - STRACE loes not recognize the 
wori NAME as a legal PM parameter, it will be ignored. 

SO DEBUGGING SUBROUTINE, CALL IGNORED. - The user has 
forgotten to supply the name of the debugging subroutine. 
The CALL condition will te removed. 



(END) 



CTSS ESCGH?.MMEH'5 GEJIDE Section AH*8^08 6-'69 



l3antj.£ication 

DEBUG - Symbolic debugging aid for CTSS. 
Lawis Morton, H4959 47 10, Room 1US-330, X5692. 

Pur£ose 

DEBUG is an extension of FAPDBG, described in the CTSS 
Progranmer* s Guide, section AH. 8.0 1. DEBUG may be used with 
any compiler or asseabler generated code which is loadable 
by the standard crss loaders {see section AH. 7). DEBUG acts 
as an execution monitor by allowing register examination and 
molif ication , and conditional execution of program sections. 
Core locations may be refered to by their symbolic names, if 
a FAP style symbol table is available on the disk. 
Interaction with DEBU3 may be from the console or a disk 
fil3. 

For a general discussion of core-S transfer commands and 
iabugging tools, see section AH. 8. 00 of the CTSS 
Programmer's Guide. At any time the user is at command 

l:^V3l with the loader in core. or after DEBUG has beer. 
explicitly leaded, the user enters the monitor by giving the 

CEBUG -FILE- 

iE i line-numbered file of the name "FILE" DEBUG exists, it 
will be used as the source of requests. If not, or when this 
file is exhausted, requests will be read from the console, 
IE not already loaded, the loader will read DEBUG into core 
from a system library. DEBUS is exactly (15000)8 words 
long. 

Ail raguests ate siagle letters followed by arguments, 
separated by blanks. Bequests may be concatenated on a line 
by using the egual sign oc apostrophe between them. If a 
request fails for any reason, other requests on the same 
lina, with the exception of ".", "S» and "P", will still be 
executed. 



CTSS EECGBAMMES»S GUIDE Section AH. 8-08 6/69 



Manipulation of the Sy mb cl Table 

DEBUG naintaias an internal table for user defined syabols. 
Currently there is space for 800 symfcols. Each synbcl Bust 
be six or fewer character, at least one character of which 
must not be an octal numter. The synbol table is created 
from a FAP style SYMIB file by the "T" and "L" requests, 
Isscribsd below. There is available a conversion program to 
create FAP style files from those produced by WAD, Notice 
that as of July, 1968, FAP puts into the SYwTB file 
indication of whether the symbol is absolute, relocatable or 
common. This information is maintained in DEBUG. However, 
SYMTB files produced before this date will appear to DEBUG 
to contain only relocatable symbols. 

The •*!•• request locates a subroutine origin and entry point. 
Its usage is 

L ENTRY 

whara "EUTBY" is a subroutine name, as found in the movie 
table. The octal origin and entry point of this routine will 
be typad on the console. 

Tha "T" request reads in a symbol table and relocates all 
relocatable symbols using the last origin found by an "L" 
raquest. Its usage is- 

r -NAMEI- 

"NAMEI " SYWTE is read from the disk- Symbols are added to 
those already in the table, and any duplicates will be 
rslafinad. If "NAME1" is omitted, the symbol table is reset 
to contain only DEBUG*s predefined symbols. 

The "W" request is a concatenation of "L" and •• 1" . Its 

format is- 

W fHTBl -8AHE1- 

anl is equivalent to "L ENTRY* T NAMEI". If "NAME1'» is 
omittad, it is assumed to be the same as "ENTRY". 

Tha "E" raquest defines a single symbol. Its usage is- 

E EXPRESSION SYMBOL 

whara "EXE8ESS ICN" is a sequence of constants or defined 
locations separated by plus or minus signs. A defined 
location is an octal numter or symbol, possibly followed by 
,a comma and a second number or symbol. If the comma is 
ptasant, the symbol following is interpreted to be a number 
between zero and seven, and tha saved contents of the 
ippropriats index tegistec subtracted frcir the value of the 



onncc Dor»r!D» MMPO t Q rinrnT? t;or-*-ir>n ftH-ft,()R fi/fiy 



first symbol. The resulting value will be assigned as the 
Vilua of "SYMBOL". 

Tha predefined symbols in DEBUS are mostly locations where 
current active registers are stored. These syobcls are 
listed in appendix 1, and way not be redefined. In addition, 
for rslocatable mode (see below), the origins of all 
subprograms may be defined in the symbol table as the value 
of tha subprogran 's name. 

Thsrs are three other special symbols: ***» , ",» and •»♦*". 
"♦•• is the last location referenced by the user in any DIBUG 
request. "." is ejuivalent to the last syiabol typed to 
DEBUG by the user. «♦♦«• is equal to zero. 

Rec|iste£ Exa J i nation and Modification 

Cora locations and active registers may be examined in 
several modes. Every register is printed out with the 
location of the word being dumped in the left margin 
followed by the contents of the word. The address may be 
printed in any of fDur modes, while the contents may be 
printed in any of twelve modes. 

The four basic modes are "R», "N", "S" and "U". In all of 
these modes, PAP operation mnemonics are used, followed by 
tha address, tag and decrement fields of the word. Bote, 
however, that all values are octal, even for FAP prefix 
mnemonics. Instructions with eighteen bit address fields 
will be printed with a fifteen bit address and a tag. 

In "R" mode, address and decrement fields are printed in the 
format "ORG+reloc" . "ORG" is the name of the first entry 
point of the subroutine in which the address is located, 
"reloc" is the octal distance from the load point. Fields 
above the initial memory bound are not relocated, they are 
rather printed in absolute octal notation. Entering "fi" mode 
will add the names of all subroutines to the symbol table. 
However, programs with the same name as a symbol already in 
tha table will not permanently redefine the symbol. The old 
definitions will be restored on entering ••»«, "S", or " U" 
mods . 

In "S" mode address and decrement fields are printed in 
octal. 

"S" mode attempts to simulate FAP assembly listings. Fields 
are printed in one of the following forms- "SYBBCL+of fset ", 
"absolute octal" or "♦♦n". Here "*" has the standard FAP 
meaning, notice that this mode is derived from FAPDEG's 
symbolic mode, but has several additional features that make 
it more readable. 



CTSS EBCGRAMMER'5 GUTCE Section AH. 8. 08 6/69 



"U" mois IS the original symtolic mode of FAFDBG. All fields 
are printed in the format "SYttBOL +o f f set" . This mode, 
tharefore, allows the user to find the nearest defined 
Symbol tc d yiven i3cation. 

In Addition to these aodes, the contents may be printed in 
any of eight other modes. The location field of this word 
will b2 printed in whichever of the four modes described 
above was last entered. 

"0" mode causes printing as a signed octal number. For 

:;onvenience, twelve digits will be tjped in the format 
'•N_NNNNN_N_NtiNliS" with nambers greater than 377777777777 
printing as negative quantities. 

"H" prints the word as six bed characters. 

"I" prints as a full word integer, "J" as a fortran 
iecramant integer. 

"F" prints a floating point number. 

"X", "Y" and "Z " modes interpret the word as a TIP style 
pointer. The pointer is printed in octal, followed by the 
tixt it points to. "X" is for six-tit pointers, •• Y" for 
nine-bit and "Z" for twelve bit. If the pointer is longer 
than 8 4 characters, only the first 84 will be printed. If 

any part of the pointer is above memory bound, ••♦♦♦" will be 
printad instead of the contents of the pointer. In order to 
use these modes, the TIP subroutine TRITE must be loaded 
with DEBUG. For more information, contact the TIP 

programming staff. 

Thesa modes are all entered in the same manner. The format 
is- 

MODE -LOCI- -L0C2- -SKIE- 

If "M3DE" is given alone, the output mode is set to this 
style for future print-outs. "LOCI" will be dumped, if 
specified, and the block between "100 1" and "LCC2" if two 
argumants are given. If "L0C2" is a smaller number than 
"LOCI", the array will be printed backwards. If the "SKIP" 
argumant is given, every "SKIP^th location batween "LOCI" 
and "L0C2" will be printed. If a sequence of locations 
contain the same value, the word REPEAT will be typed, 
instsa:! of the value. "LOCI" and "L3C2" may be any 

expression as defined in the "E" request. 



Qo^*-irMi AH H n« ../fiQ 



"R" mode is autatnatically entered on initializing DEBUG, if 
possible. If the movie table is missing or damaged, "S" mode 
is antared. "S" mode is also entered after a "W" or "T" 
request. 

The contents of a single location or block may be printed in 
the current output mode by typing just the location 
axprassions and skip expression. Of course, the first 
location must not be a single letter recognized by DIBUG as 
a raquast. The contents of ••♦♦I" may be printed by an empty 
request (carriage return or concatenation :;haracter) . 

In soma cases it is desirable to trace a chain through core. 
The asterisk request allows this by causing chains to be 
printad to any desired depth when the initial entry is 
printed out by one of the register examination requests. The 
raquest format is- 

* DEPTH 

whara "DEPTH" is a decimal integer giving the required 
depth. If the nuisber is positive, the indirection will be 
t^kan from the address and tag. If it is negative, the next 
location to be dumped will be taken from the decrement. If 
any word in the chain points to itself, the word REEEAI is 
typad and the chain terminated. Any word which is above 
memory bound will break the chain and cause "♦♦♦•• to be 
printad in the locatian field. "♦" ty itself is equivalent 
to "* 0", meaning that only the word requested, and no words 
pointad to by it, will be typed. 

£ji "F", "H", "I", "J", "H", "Y" and " Z" modes, only the last 
level printed will be given in the specified format. All 
othar levels will be printed in octal. 

Tha "D** request may be used to alter a core location or 
active register. Its format is- 

D LOC 0P1,ADD1,IAG1,DEC 1 -0P2 , ADD 2,TAG 2, DEC2- ... 

"DPI...", "0P2,..", etc, will be deposited in sequence 
starting at "LOC". "LOC" may be any expression as defined 
above, and the "OP"s may be any valid FAP instruction or 
DEBUG psuedo-op- However, all except tha last deposited 
instruction must have at least an address field. Ihe FAP 

op-code may be separated from the address field by a blank 
or a comma. Again, all numbers must be octal in a symbolic 
FAP instruction, and only type D and A instruction formats 
ara recognized. 



CTSS PHOGRAMMEH'S 3UIDE Saction AH. 8. 08 6/69 



The DEBUG pseudo-oj-S are OCT, BCD, FLO, HT , DEC, 1ST, and 
JNT. 

Th;j OCT pseadD instcuction accepts a signed or unsigned 
octal integer of absolute magnitude 777777777777 or less. 

The FLO instruction accepts a signed or unsigned floating 
DO in t number with ooticnal decimal point and ODtional E 
modifiar to denote Multiplication by a power of ten. The B 
modification is not allovied. 

The DEC, INT, and JNl pseudo instructions accept signed or 

unsigned decinal integers. DiC and IMT are equivalent, and 

cause assembly of full word integers with maximum value of 

34359738367. JNI creates a fortran decreuent integer of 
maximum value 131071. 

The BCD instruction is followed ty a single blank or comma. 
The next six characters (including blanks) are converted to 
Hollerith, and deposited. If the request terainator 

(carriage return, apostrophe or equal sign) appears before 
tha sixth character, the word will be right justified and 
blank padded. 

Depositing into CEEiJG*s special locations wil alter machine 
coniitions. Changing $MEM will cause the memory bound to 
change at the next "P" or "G" request. 

iJiQiEiJiatioQ. 2f ti^S i£SliaiLli.t2.£. 

The request formats are- 

4 -FiPWOBD- K -FAPHCRD- 

"FAPMOfiD" is a sequence of op-code, address field, tag field 
an3 decrement field as described in the "D" request. The 

"A" request places "FAPWORD" in the signed accumulator and 
rlaars the F and Q bits. It is equivalent to "C $A 

FAPWOBD". 

Th3 "K" request places "FAPWOBD" in the logical accumulator 
and clears the sign and Q bits. It is equivalent to "D $K 
FAPWCRD". 

"A" or "K" without the argument types out, in the current 
mode, the signed or logical accumulator, followed by the Q 
and F or sign and C bits. 



i^r^^*.A ^n Ku a AU 



Search Core f cr a Given 80 rd 

Core locations satisfying a given reguirement may be found 
and dumped. Format is- 

/ -LOCI- -L0C2- -.HEL.- -VALUE- -MASK- 

All locations between "LOCI" and ••L0C2" will be exaained to 
see if they contain "VALUE". The locations may be any 
expression, and "VALUE" may te any operation or pseudo-op 
recognized by DEBUG, Note that this instruction must 

:;ontain at least an address field, if "KASK" is emitted. 
".HEI." is a MAD type comparative (.E., .L., .G., .NE., 
.LE., .GE.) indicating the relation the core location must 
bsar to "VALUE". If specified, "MASK" will be anded with the 
core location and value before the comparison is made. 
"MASK" is a octal number of twelve or fewer digits. 

IE the "L0C2", ".BEL." or "VALUE" arguments are missing, the 
last value used will be assuned. If "MASK" alone is missing, 
777777777777 is assumed. If "/" alone is typed, the search 
will be started at the location following the last one found 
by the "/" request, using "L0C2", ".BEL.", "VALUE" and 
"MASK" as previously set. 

If a word is found meeting the requireirent, it will be 
printed in the current mode. If one is not found, an 

appropriate message will be printed. 

CofflfiMS Core with a Jisk BSS File 

The format is- 

C ENTRY -NAMB1- 

"EHTBY" is the name of an entry point of a subprogram 
already loaded into care. "NAMEl" BSS is the name of the 
file which is to be compared with the core image of "ENTRY". 
"SAME!" need not be specified if it is the same as "ENTRY". 

The "C" request will relocate each word in the bss file and 
coapara it to the corresponding word in core. If a 
discrepancy is fcund, DEBUS will type in the current mode 
the location, the word from the file, and the memory 
location. The phrase 20MPARIS0N DONE will signal the end of 
the comparison. 



:TSS PHOGRAMMKR'S guide Saction AH. 8. 08 6/69 8 



Ex32iJil § Single FAP Instraction 

If the user wishes tc execute a singla machine instruction, 
h2 may tjpe 

: FAPWORD 

••FAPWORD" will be interpreted and executed. Machine 
conditions may be altered by this request. The instruction 
must cause no skips. If it is a transfer, it must return to 
the next instruction. 

Storage Ma£ 

Typing "K" with no arguments causes a storage map to be 
printed. S ubprcgrams, including origins and all entry 
points, are listed in the order of their loading. 

SofltLSl 2i liccjram Execution 

The program being debugged may be run in segments, or 
stopped when a given criterion is met. Five conditional 
braaJtpoints may ba set. If the reguired condition is not 
met at the time execution reaches a breakpoint, DEBUG 
automatically restarts the program. An option is provided to 
ci use printing of a location at that time, whether or not 
the condition is met (see "V" request). Format of the break 
request is- 

B -H- -LOCI- -L0C2- -.R£L.- -VALUE- -MASK- 

"N" is a number between one and five, indicating the number 
of the breakpoint to be reset. "LOCI" is the location at 
whi-h the break will be placed. When control passes to this 
location, a break will occur if and only if "L0C2" bears the 
relation ".REL." to "VALUE". The last four arguments are 
intarpratad as they are in the "/" request, and cmifting 
them creates an unconditional breakpoint. "LOCI" and "L0C2" 
may be any valid expression as defined in the "E" request, 
except that if the expression for "LCC2" contains an index 
ragistar modification, the expression must be a single term. 

A::tiva registers may be used as the break condition. In 
addition tc the standard registers, the special DEBUG symbol 
$CDUNT is a location which contains the number of times the 
breakpoint has been passed without breaking. More than one 
breakpoint may be using $COUNT as the test register without 
::onElict. 



I- i a D 



When a break is finally reached, DEBUG informs the user 
whi=h break caused return to the monitor. It will also print 
out the nuBber of tines each breakpoint was passed without 
::iusing a break. At any treak, all counts are reset to zero. 

A breakpoint aay be removed fcy typing "B S". All breakpoints 
will be rsfflOYed b^ tw^ini^ "B" alone. Two breakpoints may 
not be set at the same location. 

fieturn to the Userls Ptoara b 

Tha "G" and "F" requests will trasfer control to the user's 
program. "E" has no arguments, and returns to the last 
breakpoint, interrupt or entry into DEBUG. The "G" request 
format is- 

G LOG 

and causes execution to begin at "LOG". Note that if "LO^" 
is at a breakpoint location, and the break condition is met, 
tha brsak will be taken immediately. 



IE a raquest fails for any reason, "G" and "P" requests 
the same line will be ignored. 



on 



A CTSS break level is set before control is given to the 
usar's subroutine. Therefore, during execution, an 
interrupt will return control to DEBUG. The location at 
which the interrupt occurred will be printed in the current 
mode. 

liEiil ReatSiets at a Breakgoint 

Any block of locations or active registers may be dumped in 
tha current mode whenever a breakpoint is reached, whether 
or not the condition for the breakpoint is met. The request 
format is- 

V -M- -LOCI 10C2- 

All locations between "LOCI* and "L0C2" will bs dumped in 
th3 current mode whenever break "N" is reached. This is 
independent of the "B" request, that is, changing a 
braakpoint will nat change the verify locations associated 
with that breakpoint. If "M" is an asterisk, all verify 
locations for all breakpoints will be set to the same. 

"LDC1" and '•L032" are expressions as defined in the "F" 
raquast, except that if they contain index register 
modifications, they must be a single term. 



;TSS FPCGHAMMER'3 guide section AH. 8. 08 6/69 10 



To shut off this featuce for a specific tceakpoint, type •♦ V 
N". "V" alone, or •' V *" will turn off all verification at 
all brsditpoints. 

lQt3£i.£tion with 3i§.§. 

Any CTSS conDPand may be executed from within DEBUG. Forinat 
of tha reyuest is- 

. COMAND -Aa31- -ARG2- .... -ARGN- 

rhe current core image is saved in the file (BUG) SAVEE, and 
tha command "COMAND A8G1 ARG2 .... ABGN" executed. Ccimand 
buffers are saved during the execution of the coaiaand. 
Rituru to BEEUG is indicated by the message DEBUG RESUflED. 

Th2 "Q" request may be used to return to comiaand level. A 
core image is retained which nay be patched, saved or 
restarted . 

DEBUG as a Sijbrout ine 

An additional entry point to DEBUG is provided, called FBUG. 
It is provided to allow a subroutine to call DEBUG directly, 
but is otherwise equivalent to the command. Requests ate 
read from the console, as usual. The "$'• request, with no 
argumants, may be used to return control to "1,U" in the 
calling subroutine. 



^^.-.^ ..r-^,^ r> >Hu cm o r-iiTnc CQ«~4-ir>n »H ft OH ft/ftQ 11 



A£Eendix J 



DEBUG Snecial SxS.fe2L§ 



JAME C0N3M1^ 

$MEM The Current Hemocy Bound 

$ILC The ILC at the Last Entry into DEBUG 

$K The Logical AccutBulator 

$A The Signed (vccumulator 

$Ma The MQ 

$X1 Index Begister 1 

$X2 Index Register 2 

$X3 Index Eegister 3 

$XU Index Register 4 

$X5 Index Begister 5 

$X6 Index Register 6 

$X7 Index Begister 7 

$SI The Sense Indicators 

$LS Lights and Switches (see below) 

JCOUKI Count cf rimes this Breakpoint was Passed 

These locations are stored in this order, and aay therefore 
be dumped in block notation by the output requests. 

The meaning cf each octal digit in the $1S register is- 

DIGIT BliNING 

1-3 Unassigned 

U Console in Twelve- bit Mode if on 

5 Flcating-pcint Trap Mode Indicator 

6 Divide Check Light 

7 AC Overflow Light 

8 Multiple Tag Bode Indicator 

9 Sense Light 1 

10 Sense Light 2 

1 1 Sense Light 3 

12 Sense Light 4 



If the digit is "I", the indicator or light is 



on 



CTSS tiiCGHAHMBH'S GUIDE Section AH, 8, 06 6/6y 12 



A££endix 2 



Sam ma £2. cf Bejguests 



A Maripulate signed AC 

B Breakpoint request 

C Coapare Bieaiory with disk BSS file 

D Deposit into cere 

E Define symbal for DEBUG symbol table 

F Set output mode for floating point 

3 Go to care location and start execution 

H Hollerith cutpct mode 

I Integer output mode 

J FORTRAN decrement integer mode 

K Banipulate logical AC 

L Locate subroutine in core 

M Print storage nap cf core 

N "NICE" output mode (octal fields) 

Octal output mode 

P Proceed from breakpoint or interrupt 

Q Quit and return to Z1SS command level 

R Relocatable output mode 

S Symbolic output mode 

T Set up symbol table 

U "UGLY" output mode 

V Set verification criteria 

W Concatenation of "L" and "T" requests 

X TIP 6-bit pointer output mode 

Y TIP 9-bit pointer output mode 
Z TIP 12-bit pointer output mode 

Execute a Crss request 

: Execute a single machine instruction 

$ Return to calling subroutine 

* Set indirection level 

/ Search for a given word in core 






A^^endix 3 
§5S£ij DJBUG Ses si on 



Lines typed by the usee are numbered in the 
left column, and connented on after the session. 



(1) debug 

W 1341.4 

DEBUG EMTERED. MEMORY BODND IS 24220. 

(2) 1 zot 

•ZOT» IS LOADED AT 7000, EWIRY POINT IS 700U, 

(3) t zot 
SYMBOLS LOADED. 

('4) 7000 7032 

HRFLX/ IIR 22033 

CHNCOB/ IIR 24044 

CHNCOM + V HTH 

ZOT-V TXL 6060,6,14663 

ZOT/ LMTM 

ZOT+V LDI INDEX+2 

LCOt/ PXD 

CYCLE/ ADD INDEX+1 

CYCLE*1/ TIF SHIFT 

INCREM-V AXT 5,1 

INCBEfl/ ACD IIiD£X*1 

ISCHEM + I/ SXA ISDEX, 1 

IHCaEH+2/ Ilf SHIFT 

SHIFT-2/ TIX mCBEM, 1, 1 

SHIFT- 1/ IRA CYCLE 

SHIFT/ PIA 

SHIFI+1/ ARS 1 

SHIFT+2/ AXr 

SHIFT+3/ TRA LOOP 

MESS-4/ TSX HRFLX, 4 

HESS- 3/ PZE MESS, 0,1 

MESS-2/ TSX CHHC0M,4 

MESS-1/ HTR 

MESS/ TIX 53360,2,44645 

IHDEX/ HTR 

IBDEX+1/ HTR 1 

INDEX*-2/ HTR 77 
( 5) b mess 

MESS/ DONE. 

(6) r 7C00== 

ZOT/ TTR HRFLX 

ZOI-H/ TTR CHNCOM+3 

ZOT* 2/ HIR 



CTSS PROGBAMMEK'S 3UIDE Section AH. 8. 08 6/69 1 ^ 



(7) ♦♦4 ♦♦1C 2 
ZOT+6/ PXD 
ZOT+10/ IIF ZOT+17 
ZOT+12/ AED ZOr+31 

(8) o zct + 6 = = 

ZOT+6/ -0 75400 00000 

ZOT+7/ C 40000 07031 

Z0T+1C/ C QU600 07 017 

(9) n * 

7010/ IIF 7C17 

(10) * 1'c zct + 22 

ZOT + 22/ IRA ZOT+6 
♦ZCT+6/ PXD 

(11) ♦ 

t^2) P 

PROGRAM RESTARTED. 

EXECUTICN. 

(13) INT. 

ZOT+U/ TIF * + 3 

(14) d shi±t + 2 Fai,0 tnz,loop 

(15) b 1 mess-4'g ZDt+U 
PBGGRAM STABTED. 
BREAK 1 AT ZOI+23. 

(16) o $a 

$A/ 00000 00000 

(17) b 1 Loop $count . e. oct,7*b 2 mess-2 

(18) V 1 $si'g zct+U 
PROGRAM STABTED. 
WONirOtt 1 AT ZOT+6. 

$SI/ OCOOO 00077 

$SI/ 00000 00037 

$SI/ G OCCOO 00017 

$SI/ 00000 00007 

$51/ OCOOO 00003 

$SI/ 00000 0000 1 

DONE. 

BREAK 2 AT ZOr+25. 
LOG 1 AT ZOr+6 PASSED 6 TIMES. 

(19) / 2ot zot + UC .e. tsx,0 777700000000 
ZOT+23/ 07U00 U 07000 

(20) sV 

MESS-2/ ISX CHMC0M,4 

(21) / 

NO WORD SATISFIES RBQUIBEM8NT. 

(22) o $Bq»$a': xca«$ing*$a 
$MQ/ -3 77777 7 77777 
$A/ OCOOO 00000 

$nQ/ c 00000 00000 

$A/ -3 77777 7 77777 



HTI T P JT 



<^or-f i on AH. B. 08 



6/69 15 



<23) . ttpeek 

08/10 1529.7 TIME USED 



SHIFT 

1 
2 
3 

U 
5 



MINUTES 



ALLOTTED 
85 
20 
10 
30 
30 



STORAGE 
DEVICE QUOTA 
DISK 200 



US ED 

24.6 

8.0 

3.2 

3.2 

.0 



US £D 
79 



2.0 



(21*) 
(25) 
(26) 
(27) 
(28) 



(29) 



DEBUG BESUflED 



1 



wcf Ix 



$CDuat . e. oct, - 1 



b 

V 

♦ 1 

h 

g zot+U 

PR3GRAH 

MONITCB 

Z0T+2t»/ 

♦ZOT+27/ DONE . 
DONE. 
BREAK 2 AT ZOT+25. 

LOC 1 AT WBFLX PASSED 

q 

GOOD BYB. 

K «J. 012*. 1416 



STARTED. 
1 AT WRFlX. 
0000 1 



07027 



1 TIME. 



CTSS FBCGRAMNfc'R'S GUIDE Section AH. 8. 08 6/69 16 



Explanation of the DEBUG session. 



( 1) At command level, the monitor is entered with the DEBUG 
coisnand. 

(2) Locate the subroutine we will be using, 

(3) and create the syaibol table from ZOT SYBTB. 

( I) Look at locations 7C00 through 7032 in the current 
mode. 

( 5) Look at location MESS in Hollerith. 

(6) Enter relocatable output mode and look at location 
700C. The empty requests (concatenation characters) 
cause the next locations to be printed also. 

(7) Look at every other word between ♦♦ U and ♦+10. Note 
that * is the last location printed by the previous 
request, and that all numbers used in the request are 
octal . 

{4) S2t octal fflode and look at ZOT + 6. 

(9) Go to "N" mode and look at the current location. 

(10) Sat indirection level to 1, and look at ZOI+22 in 
relocatable mode. 

(II) Restore indirection level to zero. 

(12) Proceed fron last entry into DEBUG. In this case, since 
thara had been no execution before DEBUG was entered, 
start at the beginning. 

(13) We decide there is an infinite loop, and give an 
interrupt. DEtUG responds with the location of the 
interrupt. 

(14) Daposit the correct instructions. Bote the address 
field on the PAX instruction. 

(15) Sat a breakpoint at MESS-4 and start execution at 
ZDT+U. Hote that we are in relocatable mode, therefore 
the symbol ZOT refers to the program origin, rather 
than the value cf the location ZOT in the subroutine. 

(16) Look at the accumulator. 

(17) Sat a conditional breakpoint at LOOP. The break will be 
taken at the seventh time execution reaches this point. 
Sat a second unconditional breakpoint at MESS-2. 

(IB) Verify the sense indicators at breakpoint 1, and start 
from zOT+a. 

(19) Look for a TSX instruction between ZCT anJ ZOT+UO. The 
octal mask insures that any TSX will be found. 

(20) Switch to symbolic mode, and try to find another TSX. 

(21) Try for one more TSX. 

(22) Look at the HC and AC. Then execute an XCA instruction, 
and look at them again. 

(23) Exacute the CTSS command TTPEEK froB within DEBUG. 



cnr"*- ■; /%»> 



n 



(24) 
(25) 

(26) 

(27) 

(28) 
(29) 



Put a breakpoint at WHFLX. Mote that 
caach -^ , hence the break will never 
However, we may verify 
raaches that point. Here 



JCCUNT will never 

be taken. 
a register whenever control 
we wish to look at 1,4, which 



will be the argument to the subroutine HRFLX. 

Sat indirection level, so that we can see what the 

ar'^u™ent joints to. 

and go to Hcllerith mode, since the argument is BCD 

text. 

Begin execution at ZOI+4, 

Ha are all finished. Exit back to CTSS coramand level. 



(END) 






Ptint stccage maf 
STOMAP 

Purpose 

To print the storaye map from the (MCVIE TABLE) file created 
by tha staadard loaders (i.e., every loader not using the 
• (OLD) • opticn) . 

Usaje 

STOMAP 
Prints the file • (MOVIE TABLE) • on the user's console. 

STOMAP ALPHA 
craatss a file 'ALPHA MAP* containing a numeric and an 
alphabetic storage aap of the file '(MOVIE TABLE) •. 

STOMAP ALPHA BETA 3AHMA 
Craatas a file 'ALPHA MAP' from the file 'BETA GAMMA'. If 

GAMMA is emitted, '(TABLE)' is assumed. If ALPHA IS 

•(ONL) ', tha storage ai ap will be printed on-line. 



(END) 



v-i"ia t-Ki-^jHflnnrK-a tjui^r 



^ in^i, ±fjii n n^ 






Iii.Iilili.£*tion 

Hanuscript typing and editing 
TYPSET, BUWOFF 
J. Saltzer, X6039 



PI 1 r- »-» /~fc CT ?^ 



Th3 cofflmand TYPSEr is used to create and edit 12- bit BCD 
line-mar ked files, This coamand permits editing and 

ravising by context, rather than by line nuaber. The 

command KUNOFF will print cut (in a format subject to 
control words placed in the file via TYPSET) a 12-bit BCD 
line-marked file in manuscript format, BUSOFF contains 

savaral special contrsl features which were not available 
with the DITTO command, including type- j ustifi cation . 

References 

This work represents Dne more iteration in the arduous task 
oE -raating an "ultimate" editing scheme. As sach, it is 
primarily a synthesis of technigites which have been proven 
valuable in several separate problem areas. It is felt that 
this particular synthesis brings to bear on the editing 
problam an easy to use package of technigues, and might 
provide a model for an editor on a ••next generation** 
tiraa -sharing system. Here is a list of some of the sources 
of ideas for these commands: 



J, 


McCarthy 


s. 


Piner 


p. 


Samson 


Comp , Center 


M, 


L. Lowry 


a. 


P , Qarnett 


V. 


H. Yngve 


R. 


S. Fabry 


A. 


L. Samuels 


F. 


J. Ccrbato 



staff 



(Colossal typewriter) 

(Expensive Typewriter) 

(Justify) 

(Input, Edit, and File) 

(Memo, Modify, and Ditto) 

(Photon) 

(Coait, Vedit) 

(Hadbug) 

(Edits) 

(Revise) 



CTSS EPCGRAMMER'S GUIDE Section AH. 9. 01 12/69 2 

M Edit-ty-Context Program 

££Oi£§.S. Haas • r 5^ Pi> ET 

Description 

TYPSET is a command pcogram used to type in and edit 
memorandUB files of English text. TYPSBT, along with the 
command BUNCFF, is a replacement for the (old system) 
comnands MEMO, MODIFY, and DITXC. Editing is specified by 
ciontext, rather than line numbec, and input is acconplished 
at high speed since the program does not respond between 
1 ines. 

ysaie 

lYPSET name 

"name" specifies the primary name of a file to be edited, or 
of a file to be created; it may be absent, in which case a 
file is to be created, and must be named later by the "FILE" 
request. 

When TYPSET is ready for typing to begin, the word "Input" 

or "Edit" is typed, and the user may begin. If he is 

creating a file, he begins in high-speed input mode; if he 
is aditing a file, he begins in edit mode. 

Hi jh -Spaed In put Mode 

In high speed input mode, the user may type lines of up to 
360 characters in length (e.g., 120 underlined characters) 
separated by carriage returns. He does not wait for 

response frooo the program or the supervisor between lines, 
but may type as rapidly as desired. The full character set 
of his keyboard may be used. 

The user leaves high-speed input mode and enters edit mode 
by typing an extra carriage return. When switching modes, 
the program acknowledges the switch by typing the name of 
tha new mode, "Input" or "Edit". 



Ea.it Mode 

In Edit mode, the program recognizes "requests" of the form 
given below. All requests take effect ianediately on a cogj 
of tha file being edited. Except where a request is 

axpactad to cause a response, such as "PRINT," successive 
requests may be entered iraaadiately on successive lines 
without waiting for a response from th€ prograi. Each 

separate request must begin en a separate line. Program 

r^sponsas are typed in red, if you use a two-color ribbon. 



Ha, 7. u I I ^/ o^ 



£tiJ£5ctec Set 

Tha standard 12-bit character set is available. (see 

Section ftC.2.01.) The preset erase character is # and the 
praset kill character is S . 

R e^uests 

Editing is dene line by line. We may envision a pointer 
which at the beginning of editing is above the first line of 
the file. This pointer is moved down to different lines by 
sons requests, while ather requests specify some action to 
be done to the line next to the pointer. All requests 
axcapt FILE may be abbreviated by giving only the first 
latter. Illegal or misspelled requests will be coicniented 
upon and ignored. 

For purposes of description, the requests have been divided 
into two categories, those necessary for effective use of 
the command, and specia 1- purpose requests which are not so 
ganarally useful. The first category includes eight 
requests: 



LOCATE character string 

This request moves the pointer down to the first line 
which contains the given character string. Only enough 
of the line need be specified to identify it uniquely. 
Since the pointer only moves down through the file the 
second occurrance of a line containing a given 
character string may be located by giving the LOCATE 
request twice. The line which has been found is 
printed in its entirety. 

It is not necessary to count blank characters exactly. 
If one blank character appears at some point in the 
request string, any number of blank characters or tabs 
at the corresponding point in the file will be deemed 
to satisfy the request. If 2 blank characters appear 
together in the request string, there must be at least 
two blank characters or tabs at the corresponding point 
in the file, etc. 

If the LOCATE request fails to find a line containing 
the given character string, a message is printed, and 
the pointer is set to point after the last line in the 
file. Any requests which were typed in between the 
LOCATE which failed ind the message from the program 
about the failure are ignored. Another LOCATE request 
will move the pointer bask to the top of the file to 
begin another scan down through the file. 



CTSS PROGfiAMMER'S GUIDE Saction AH. 9. 01 12/69 U 



PRINT n 



Starting at the pointer, n lines are printed on the 
typewriter console. The pointer is left at the last 
line printed. If n is absent, 1 line is printed and 
the pointer is not nioved. If the pointer is not at a 
line (e.g., above or below the file, oc at a line just 
deleted) only a carriage return is typed. 



NRXT n 



This request moves the pointer down "n" lines. If "n" 
is absent, the pointer is moved to the next line. 



DELETE n 

This request deletes "n" lines, starting with the line 
currently being pointed at. The pointer is left at the 
last deleted line. If "n" is absent, the current line 
is deleted and the pointer not moved. 

INSEBT new line 

The line "new line" will be inserted after the line by 
the pointer. The first blank following the request 
word is part of the request word, and not part of the 
naw line. The pointer is set to the new line. To 

insert more than one line, give several INSERT 
raquests, or just type a carriage return to switch to 
high-speed input mode. All lines typed are inserted 
after the line being pointed at. When the user returns 
to edit node by typing an extra return, the pointer is 
sat to the last inserted line. If the very first edit 
request given is an INSERT, the inserted lines are 
placed at the beginning of the file. If an INSERT is 
given after the pointer has run off the bottom of the 
file, the inserted lines are placed at the end of the 
file. 

CHANGE /String 1/string 2/ n G 

In the line being pointed at, the string of characters 
"string 1" is replaced by the string of characters 
"string 2". If "string 1" is void, "string 2" will be 
inserted at the beginning of the line. Any character 
not appearing within either character string may be 
used in place of the "slash" character. If a number, 
"n", is present, the change request will affect "n" 
lines, starting with the one being pointed at. All 

lines in which a change was made are printed. The last 
line scanned is printed whether a change was nade or 
not. The pointer is left at the last line scanned. If 
the Ifftter ''G" is absent, only the first occurrence of 
.. "string 1" within a line will be changed. If "G" is 






present, all Dccarcences of "string 1" within a line 

will be changed. If "string 1" is void, "G" has no 

affect. Blanks in CfiAN GE-r eguest strings isust be 
counted exactly. 

Example: 

line: It is a nice day in Boston. 

request: CHANGE /is/was/ 

new line: It was a nice day in Boston. 

request: CHANGE xwasxisx 

new line: It is a nice day in Boston. 

request: CHANGE » ••• g 

new line: It -is. a. nice. day. in. Boston. 

request: CHANGE •. •• 

new line: Itis. a. nice. day. in. Boston. 

request: CHANGE "tis"t is" 

request: CHANGE ». * • G 

request: CHANGE 'on 'on.* 

new line: It is a nice day in Boston. 



FILE name 



This request is used to terminate the editing process 
and to write the edited file on the disk. The edited 
file is filed as "name <MEMO)". If "name" is absent, 
the original naae will te used, and the older file 
deleted. If no name was originally given, the request 
is ignored and a coaiaent taade. If "name" is given and 
a file cf that name already exists, the user will be 
asked if he wishes to delete the old file. When this 
request is finished, the user returns to command level, 
and the supervisor will respond by typing "B" and the 
time used. 



TDP 



This request moves the pointer back to above the first 
line in a file. 

Tha following seven requests are handy for special purposes, 
but will probably not be used as often as the ones 
previously described. 

B3TT0M 

This request moves the pointer to the end of the file 
and switches to input mode. All lines which are then 
typed are placed at the end of the file. 

ESASE c 

The character "c* becomes the erase character. 

normally, the character " »" is the erase character. 

{The erase character is used to delete the previously 



CTSS EECGBAMMfc8«3 GUICE Section AH. 9. 01 12/69 6 

typed chardcter or characters.) 
KILL c 

The character "c" becomes the kill character. 

Nornally, the character "i" is the kill character. 

(The kill character is used to delete the entire line 
curcGiitly being typed.) 

APPEND character string 

Tha string of characters "character string" is appended 
to the line being pointed at. 

VERIFY p 

If the parameter, '• p" is "OFF", the following program 
responses are not automatically typed: 

"INPUT" or "EEIT" when the mode is changed- 
Lines found bj the FIND or LOCATE requests. 
Lines changed by a CHANGE request. 

If the parameter "p" is "ON*, the responses are 
restored. The command tegins in "ON" mode. 

RETYPE new line 

The line "new line" replaces the line being pointed at. 

The first blank following the request word is part of 

the request word and therefore is not part of the new 
line . 

FIND character string 

This request Boves the pointer down to the first line 
which starts with the given character string. 

SPLIT name 

All the lines above the pointer are split into a file 
called "name (MEMO)". Any old copy of "name (MEMO)" is 
daleted. The remainder of the file may still be 
edited, and filed under another name. The SPLIT 

raquast may be used several times during a single edit, 
if desired. Unless at least one "TOP" request has been 
given, "name" must te different from the original name 
of the file being split. 

BREAK c 

The character "c" becomes the break character, i.e. to 
switch from input to edit mode or from edit tc input 
mode, type "c " followed by a carriage return. If "c" 



QUIT 






is not specified on the BREAK request, the nornal mode 
(carriage return only) is restored. 



This request is used to terminate the editing process 

without creating a new file. All intermediate files 
are deleted, and the user returns to coBiaand level. 



5l5.!i§£i£i.Iia 

The backspace key may be used to create overstuck or 
undarlined characters. All overstruck characters are stored 
in a standard format, independent of the way they were typed 
in. CHANGE-, LOCATE- and FI ND-r equest strings are also 
converted to this standard fornat, so it is not necessary to 
remember the order in which an overstruck character was 
typad in order to identify it. For exaaple, suppose the 
line: 

The N0BNAL N(2EE statement of BAD 

hdd teen typed ia by typing the letters NCRMAl, five 
ba:;kspaces, a slash, and four forward spaces. The slashed p 
in NjeRMAI can be changed to a standard C ty typing 

CHANGE 'p'O* 



SS§tricted Names and Recovery Procedures 

Two special names are used for intermediate files by TYPSEI. 
The y are : 

(INPUT prog 

(INPT1 prog 

where •prog* is the user's programmer nuafcer. Following a 
QUIT sequence (or a CTSS system breakdown) one or both of 
these files may be found. (Whenever a QUIT sequence has 
been given, a SAVE comiBand should be issued to save the 
status of all files.) Because the (INETI prog generally 
contains a complete capy of the file since the last TOP 
command, it lay be renamed and used as a source file, and 
may permit recovery of lost requests. The (INPUT ptog 

contains only that part cf the file above the pointer, and 
therefore contains only a partial record of the original 
fil3. The original file is never deleted until the new, 
edited file has been successfully written and closed. 

Tha intarmediate files are normally written in permanent 
mode. If the user's track quota becomes exhausted while 
aditing, TYESEr will switch to temporary mode intermediate 
files. If it is necessary to leave the edited file in 



CrsS EPCGRAMMKR'5 GUIDE 



Section AH. 9.01 



12/69 8 



temporary node, a comment will be made. 

IE a naw tile name is to be created (includicg these 
intermediate files) and the user already has a file of the 
sima name in his directory, he is first asked if he wishes 
to delete the eld tile. 



uxDO rnuunanana " :i vsuxuc saczxon Atl.^.ut l//6y y 

Suiniaacy of TKPSET requests. 

abbrev. ISSJ^ist ISJPcnse 

Bisic requests: 

L LOCAIE string line found ♦ 

end- of- file 

D DELErE n end- of- file 

N NEXT n end- of- file 

I iNSERr line none 

P PRINI n printed lines, 

end- of- file 

C CHANGE QxxQyyQ n G changed lines * 

T TOP none 

FILE name Baady message 

Spacial-purpose requests: 

B BOTTon "Input" ♦ 

V VERIFY ON (or OFF) none 

S SPLir name no name given 

R R£ryPE new line none 

E ERASE X none 

K KILL X none 

A APPEND string none 

F FIND string line found * 

end- of- file 

Q UUIT Beady message 

* Thase responses will not occur if VERIFY mode is cff. 



CTSS PROGRAMMER'S GiUIDE Seotion AH. 9. 01 12/69 10 

A Right- Justifyiny Type Cut Erogram 

P£2iL£^£ Descrigtion 

RUHOFF is a coainiand used to type out laeinoranduiB files of 
English "text, in Manuscript format. Control words scattered 
in the text may be used to provide detailed control ever the 
format. Input files may be prepared by the context editor, 
TYPSET. 

Usa^e 

RUNOFF SAMEI -Pi- -P2- ... -Pn- 

NAME1 is the primary name of a file "NAMEl (MEHO)" 
to be typed out. 

P1,P2, etc., are any number of the 

following parameters, in any order: 

STOP Pause between pages. 

NCWAIT Suppress the initial pause to load paper and 
the pause between pages. 

PAGE r Begin printing with the page nuibered "n ". 

BALL n Typewriter is using printing ball "n". If 

♦■V-io r^^r- =ima¥ ar 4q nitliftAfl. Runoff aSSUIBeS 

that the tall in use will properly print all 
CISS characters in the file. The number "n •• 
is engraved on top of the printing ball. 
CISS characters not appearing on the ball 
being used will be printed as blanks, so that 
they may be drawn in. 

Control Words 

Input generally consists of English text, 360 or fewer 
characters to a line. Control words must begin a new line, 
and they begin with a period so that they may be 
distinguished from other text. RUNOFF does not print the 
control words. 

.line length n 

S3t the line length to "n". The line length is preset 
to 60. 






indent n 



set the number of spaces to be Inserted at the 
baginning of each line to "n". Indent is preset to 0. 

undent n 

In an indented region, this control word causes a 

break, and the next line only will be indented n spaces 

fawer than usual. Ihis control word is useful for 

typing indented numbered paragraphs, 

.paper length n 

This control word is used for running off a raeBorandum 
file on non-standard paper. The number "n •• is a line 
count, figured at 6 lines per inch. If this control 
word is not given, "n" is assumed to be 66, for 11-inch 
paper . 

.singla space 

Copy is to be single spaced. This node takes effect 
after the next line. (The normal mo:le is single 

space. ) 

.double space 

Copy is to be double spaced. This node takes effect 
after the next line. 

.bagin page 

Print out this page, start next line on a new page. 

.adjust 

Right adjust lines to the right margin by inserting 
blanks in the line. The next line is the first one 
affected. (This is the normal mode.) 

-ne a 
.no just 

Do not right-adjust lines, 

.fill 

Lengthen short lines by moving words from the following 
line; trim long lines by moving words to the following 
line. (This is the normal mode.) A line beginning 
with one or moce blanks is taken to te a new paragraph, 
and is net run into the previous line. 



CTSS fBCGRAMM£R'5 GUIDE Section AH. 9. 01 12/6'J 12 



.nofill 



Print all lines exactly as they appear without right 
adjustment or filling out. 



•page -n- 



Print page numbers , (The first page is not given a 
page nuuber. It has instead a two-inch top margin. 
593 also "Maauscript Conventions", below.) If "n '• is 
present, insert a page treak and nunfcer the next page 
••n" . Note that RUNOFF does not print completely empty 
pages. 

.space - n- 

Insert •• n" vertical spaces (carriage returns) in the 
copy. If "n " carries spacing to the bottom of a page, 
spacing is stepped. If "n" is absent or 0, one space 
is inserted. 

header xxxxxxxxxxxxxxxx 

All of the liae after the first blank is used as a 
header line, and appears at the top of each page, along 
with the page number, if specified. 

.braak 

The lines before and after the ".break" control word 

will net 

operation 

.center 



Will n*^4- Kfu -mn 4-/-\rT^*-l-»£iT" Ky +-k£i ll^iTlH 



The following line is to be centered between the left 
and right margins. 

.literal 

The following line is not a control word, despite the 
fact that it begins with a period. 

. heading mode P 

This ccntEcl seguence alters the mode of the running 
head to that specified ty the parameter "P" . Any of 
the following parameters are allowed: 

CENTER The header will ba centered on the page. 

MARGIN The header will be adjusted against the right 
margin of the page. 



r% r\ ■ 



CT5i3 FKUCiKAnnKK ' b jUlUC aecjcioii iin.a.ui i^/oj 



FACING On even-numbered pages, the header will be 
adjusted against the left margin, on odd 
numbered pages against the right. 

OFEOSED The header will be adjusted against the 
opposite margin from the page number. 

In the absence of a .HEADING MODE control 
sequence, the default option is OPPOSED. 

odd page 

This control word causes the current page to be printed 
out, and the next page to be numbered with the next 
highar odd page number. 

.paging mode PI P2 ... Pn 

This control sequence alters the mode of page 

numbering to that specified by the parameter El, P2, 

ate. The Pi's may be in any order, and selected from 
the following list: 

MABGIN Page numbers will be adjusted against the 
right margin. 

FACING Odd page numbers are adjusted against the 
right margin, even page numbers are adjusted 
against the left margin. 

CENTEfi Page numbers are centered between the eight 
and left margin. 

TOP Page numbers are placed on the fourth line 
from the top of the page. 

BOTTOM Page numbers are placed on the fourth line 
from the bottom of the page. 

OFF Page numbers are discontinued. 

PREFIX "string" The string of characters between 
quotation marks is prefixed to the page 
number. The quotation marks may be next to 
each other, in which case no prefix is used. 

RCHANU Page numbers will be printed in upper case 
soman numerals. 

aOMANL Page numbers will be printed in lower case 

Roman numerals. 

ARABIC Page numbers will be printed in Arabic. 
(This is the normal mode.) 



CTSS EBOGKAMMEH'S GUICB Section AH, 9. 01 12/69 14 

SET n Set the next paye namber to be "n". 

SKIE n Skip "n " page nuBfcers. 

If in a single use of .PAGING MODE several pi's specify 
competing functions, the last one specified takes 
prscedence. When the .PA3IM3 MODE sequence appears in 
taxt at point A, all text up to A (and probably some 
text after A) will appear on a page controlled by the 
previous paging mode. The new paging mode will take 
effect en the next page. Then there is no danger of 
getting page numbers both at the top and bottom of the 
same page. 

Use of the TOP paraaieter may conflict with the heading 
mode. If a heading and a page number should be printed 
in the same column, the page number will take 
precedence. 

In the absence of a .PAGING MODE control sequence, the 
default options are: TOP HABGIB PREFIX "PAGE " 

.append A 

Take as the next input line the first line of A (MEMO) . 
Note that the whole of A is appended, and that the 
appending is an irreversible process - that is, once 
RUNOFF encounters the .APPEND control word it will 
switch to file A (MIMO) and continue from its first 
line. Other text in the original fila (which contained 
tha control word) will not be processed by RUNOFF. The 
file A (MEMO) may, of course, itself call for appending 
of still another file, and so on. 

All control words may be typeti in either upper case or lower 
:;iS3. Illegal control words are ignored by the RUNOFF 
command. A comment may appear to the right of a control 
word, as long as it is on the same line. 

Abbraviati_ons 

All control words may be abbreviated if desired. A list of 
abbreviations is given in the summary. In most cases, a 
single word is abbreviated by giving its first two letters; 
two words are abbreviated by giving the first letter of each 
w or d . 



Ma_nu script Conventions 

The RUNOFF program assumes a page length of 11 inches, with 
6 vartical lines per inch. The top and bottom margins are 1 
inch, except for the first page which has a 2-inch top 
rairgin. If a header is used, it will be placed 1/2 inch 



fTcc: r>Drtr:n A NMRR • Q miTnP ^c.f' ti r»n AH-Q.(i1 1?/fi<J IS 



from the top of the page. Ihe first page is not numbered, 
nor is it given the header line, unless the control words 
•♦.header" and ".page 1" appear before the first line of 
text. 

Customary margins are 1-1/2 inches on the left and 1 inch on 
tha right, implying a 60-character line. This is the 

standard line length in the absence of margin control words. 

Unless restrained from doing so by NCWAIT, the program stops 
bafora the first page for loading of paper. The STOP 

parameter will cause a stop between all pages. The paper 

should be loaded so that after the first carriage return 
typing would take place en line 1 of the paper. The left 

margin stop cf the typewriter should be placed at the point 
typing will begin, and the right margin moved as far right 
as possible. Mow, when you type the first carriage return, 
tha program will start typing and continue to the end of the 
fil3. 



Tibs 

When performing right-adjustment, the RUhOPF camraand does 
not take special account of the tafculate characters. 
Therefore, tabs should net be used unless "fill" mode is 
off. If tabs on a 1050 are not set at the CTSS standard 
settings of 11, 21, 31, etc., the supervisor may mistime 
::haracters or insert extra carriage returns. For this 

reason, use cf tab characters is not recoamended. 

If a mamo does use tabs in a section where "fill" is off, 
the mechanical tab stops on the typewritar must be set 
properly. The following conventions should be used in any 
memo which uses tabs: The first two lines of the memo 
should contain two comments, beginning with the words ".SET 
TABS AT", followed by a String of blanks and x*s, with the 
x's positioned at the desired tab stop positions. The 

second comicect should be ".TABS SET AT" followed by a string 
of tabs and x»s. If the typewriter is correctly set up, the 
typset reguest "PRINT 3" will cause the two lines to be 
printed cut with the x's lined up. Since the supervisor 

assumes that tab stops are at 11, 21, 31, etc., a line with 
too many tab characters may appear to overflow the carriage 
siza, and the supervisor may insert extra returns. 

Backspacing 

Underlining or overtyping may be accomplished with the aid 
of tha backspace key, even in a line that is subject to 
right adjustment. 



Crss EFCGFAfi«ER»3 gU ICt Section AH. 9. 01 12/69 16 

Summary of RUNOFF Control Words 



^bbrev. ccnttcl wcrd 



• he , header xxxjj 

• br .break 

. ce .center 

. li .literal 

■ hm .heading node P 



pro .paying mode P 



automatic break 



•ap .append A no 

• 11 .line length n 

-pl -paper length n 

-in .indent n 

. un .undent n 



no 
no 
no 
yes 

• ss .single space yes 

-ds .double space yes 

•bp .begin page yes 

.ad .adjust 

.fi .fill 

• nf , nof ill 



yes 
yes 
yes 



P^ • page (n) yes, if n 

sp .space (n) yes 



no 

yes 

yes 

np 

no 



op .odd page yes 



no 



If "autonatic break" is yes, the lines before and after the 
::ontrol word will never be run together, and the previous 
line will be printed out in its entiraty before the control 
word takes effect. 



(END) 



- -., _,^«v n u O f\ "i O 4 CC 



I dgntif icaticn 

Usars talk to GOD 
REMARK 

Purpose 

Usars may address theaselves to "whom it Bay concern". The 
users' remarks file is printed off-line each day and the 
oparations staff directs the printed copy to the appropriate 
members of the systenss programming staff. 



Usa^e 



REMARK HAME1 NAHE2 

The 6-bit B3D file NAMB1 HAHE2 which contains 
the usee's remarks is appended to a PUBLIC 
file called USER HEHABK. This file is printed 
each day by the operations staff and delivered 
to the addressees. If NAME2 is omitted, it is 
assumed to be BZD. If NAKE1 and NAME2 are 
omitted, instructions for using the command 
are printed. 



(END) 



CTSS PROGRAMMER'S SUIDE Section AH.y.Ub 2/66 i 



I^entif icaticn 

Mail conmand 
M&IL 

Pur£OS3 

To place a file containing a messaye to another user in his 
file directory, whether he is logged in or not. 



Usaje 



MAIL MAHE1 MAME2 PHOBi PROGl ... -EfiOBn FBOGn- 

BAIL NAME! NAMi2 ' (LIST)' LNAHE1 LNAHE2 



NAME! NAME2 is the name of the file to fce sailed. It Bust 
be line-marked, and no more than 1 record in 

length . 

PHOBi PROGi are the users to which mail will be sent, 

(LIST) If the • (Ll^l) ' option is given, the file 

LNAME1 LNAME2 will be used as a »«aailing 
list", and mail will be sent to all PaOBi 
FRCGi pairs in the file. The file may be 

card-iaage or line-marked; its foriBat is 

free, except that iteas must be separated by 
spaces. 

Wail will be placed in a file named MAIL BOX in the records 
of user PHOBi PROGi. If the file already exists, it will be 
appandad to. Each piece of mail is prefaced with a message 
of the form "FROM OSRPB GSRPG DATE TIME" where DSRPE is the 
s^nler's problem number, USRPG is the sender's pragraamer 
number, and DATE and TIME have the usual meanings. (To 

iscartain whether he has received mail, the user should 
perioicdlly - daily, perhaps - issue the command 'PRIHT MAIL 
BOX'. Because of the appending feature of the MAILing 
process, the command 'DELETE MAIL BOX' should be issued 
aftar a massage has been PRINTed, to avoid having to run 
through previous nesages to get to the latest one.) 

Any PROBl or EBOGi may be '*', meaning "all"; the command 
will search the MFD and send mail to all users (but not to 
common files) satisfying the criterion. However, '♦ ♦' will 
not cause mail to be sent to all users. 

Typing the caismand 'MAIL* without arguments is equivalent to 
asking for instructions on how the command is to be used. 

To avoid getting mail, one may place in his tracks a file of 
niffls MAIL BOX with PRIVATE mode. 



CTSS PROGRAMMEB'S SLIDE 



Saction AH. 9. 05 2/66 2 



If an addressee is over his record quota, 'MAIL BOX' will be 
writtan in temporary mode. 



Kastriction 



If the receiver's MAIL BOX is PRIVATE, 
READ-ONLY, mail cannot be delivered. 



PROTECTED or 



(END) 






Run off ASCII memDrandutn files 
RDFF 

Purpose 

ROFF is a ptogcam used to type out menoranduni files of 
English text, in nidnuscLipt format. Control words within 
th2 ASCII source file may be used to provide detailed 
control of the fcrniat of the document produced. BOFF is an 
aiptation of the RUNOFF command (see AH. 9. 01) for ASCII file 
input. Since ASCII files contain no line-marks and have four 
characters per word instead of three, a user can obtain a 
significant saving in file space by using EDA and ROFF 
instead cf TYPSET and RUNOFF. 

Usaje 

ROFF namel -pi- - p2- ... 

RDFF will read the file "namel ASCII" and produce 
output in manuscript form. The optional 

parameters pi, f2, etc. may appear in any order. 
They may be any of the following: 

STOP will cause a pause between pages so that the paper 
may be changed. Typing will resume when carriage 
return is struck. 

NOWAIT will cause the initial pause to load and position 
paper to be suppressed. Typing will begin 

iffiffediately. 

PAGE n will begin output with the page numbered "n" . If 
pages are nat numbered , no output will result. 

BALL n will cause ROFF to assume that the console used 
for typed output has a typing element of type "n". 
ROFF assumes that all characters in the file can 
be typed with the typing element. CTSS characters 
in the file "namel ASCII" which do not appear on 
the ball will print as blanks, so that they can be 
drawn in by hand. 

PRINT will cause BOFF to produce an ASCII character 
stream file "namel RUNOFF" as output instead of 
typing 3n the console. 

Control Ho rd s 

The control words tor ROFF are the same as those for RDNOFF, 
with the following exceptions: 



CTSS PROGRAMMER'S 31EDE Section AH. 9. 06 6/69 



NEED control word: ".need n" 

Start a new page of output if there are not "n " 
lines lemaiaing to be printed on the present page. 
This ccntrcl wcrd is useful for keeping tables and 
figures froi being split across a page. (This 
control word must follow a control word which 
causes an automatic break.) 

INSERT control word: ".insert file naiBe3" 

The input stream will be diverted to file NAME3 
ASCII. When all input from IIAME3 is exhausted, 
ROFF will revert to taking input from NA ME 1 ASCII, 
".insert file" control words maj not be nested. 
This control word causes an automatic break. 

The abbreviation for ".insert file" is ".if" and the 
abbreviation for ".need" is ".ne". 



(END) 






Identification 

Print files in public file directory 
PINFO 

Purpose 

To allow users tc print files (INFO files in particular) 
accessible through the public file directory MTJIS CMFL04. 

PINFO NAMEI -NAME2- 

PINFO will switch to the public files via a call to TSSFIL, 
opan NAMEI NfllllE2 foe reading/ return to the user's file 
directory via a call to DSRFIL, and print the file on the 
tirminal. The file may be either line-marked or card-image. 
If 'NAME2' is omitted, 'INFO' is assumed. 

Ex amjgles 

Thare are short descriptions of most system commands in 
umifc CMFLC4 as files of second name 'INFC. To find out how 
to US3 a command, for example •APEND', type: 

FISFO APENC 

If tha appropriate INFO file exists, it will be printed. To 
obtain a summary of changes to INFO files, print the file 
•NEWS INFO*: 

PINFO NEWS 

To obtain a list of all available INFO files, type: 

LISTF (SYS) * INFO 

To print the message of the day (printed also by LOGIN), 
typa : 

FINFO MESS AG TOCAY 



(END) 



^^^ ^ T. i^i^r^ nmaiMrnl:? r^ri Tr« Qof'firin AH-IO-OI 12/69 1 



I d en t i f i c a t i en 

Macro Command 
RUNCOn, CHAIN 

Purijosa 

Public and private cammands may be linked or chained 
together in order that the chain may be executed by merely 
issuing one command. This is convenient if the same series 
of commands is tc be executed more than once and the user 
does not wish t3 retype the series each time. Arguments to 
the commands may be specified at execution time. 

Reference 

Saction AG. 8 gives further information afcout macro coaaiand 
programs. 

Usatje 

Command Chain: 

The command chair, or oiac ro-coffliaand, must first be prepared 
as a BCD line-marked or line-numbered file, with one command 
per line. Blank lines are ignored. Command arguments are 
separated by one or more spaces; if an argument is more than 
six characters long, it will be truncated from the left. 
Arguments may be command names, actual argument values or 
dummy symbols. If dummy symtols are used, there must be a 
list of the dummy symbols specified by the pseudo-command 
CHAIS somewhere before the first executatle command. 



Example 


of a 


macro- cottaand: 


CHAIN 


ALPH 


BET TBANSI 


ED 


ALPH 


TRANSL 


PBINTP 


ALPH 


IBAMSL 


IRAHSL 


ALPH 




LOAD 


ALPH 


BET (LIBE) OWNLIB 


etc. 







CoBments may be included in the command chain 
as lines which have as the first character an 
•*• or a •$*. Comments introduced by •♦' will 
be ignored during execution. Comments 

introduced by •$• will be printed on the 
user's console at the point of execution 
corresponding to their position in the chain. 



CTSS FBGGRAMMEB*S GUICE Section AH. 10.01 12/69 2 

Kxar^ution of CommaQd Cbain : 

RUNCOM NfiMEl ARGI ARG2 ABGn 

NAME1 is the primary name of the BCD conmiand chain 
file NAME1 HUNCOM (OE NABBI BCD). 

AHGi are the argunents to be substituted for the 
dummy symbols (if any) in the saoe order as 
specified in the pseudo-comiand CHMN. If any 
AHGi is • (NIL)', the corresponding duaniy 
argument will te ignored; if it is substituted 
for a conmand nane, the whole comnand is 
ignored. If any ARGi is • (END)', it will be 
replaced by a fence (all 7's). Any additional 
arguments will be ignored by commands in which 
this substitution is performed. If (END) is 
substituted as a command name, the chain is 
terminated at this point. If there are fewer 
ABGi than dummy symbols in the CHAIN 
specification, the rightmost dummies will 
retain their literal values. 

RUNCOM will interpret the file NAHE1 SONCOM, 

substitute the explicit arguments for dummy 
arguments, if any, and perform the execution 
of the specified commands ty appropriate use 
of the supervisor command chain buffers and 
subroutines- RUN30M contains a list of public 
coHmands indicating whether or net each 
Conmand assumes a current core image; RUNCOM 
can then properly intersperse the SAVE and 
RESUME commands. Nesting and recursion are 
possible. 

Core image management: 

Some mere details may be necessary to understand the 
mechanism whereby RUNCOM takes care of core images 
between commands. 

As a general rule, a core image is kept over two 

consecutive conmands if, and only if, the first one is 

supposed to leave a core image, and the second one is 
supposed to expect a core image. 

e. g. LOAD - SAVE - FAPDBG 
Use the same core image created by the LOAD coBmand. 

Whereas LOAC - SAVE - LISTF does not keep the core 
image frcm SAVE to LISTP. Commands which are supposed 
to leave a core image are: 



I £, / \j J J 



CIESTI to 3TEST9 

LOAD VLOAE NCLOAD LOADGO LDABS USE START 

PH TRA STOPAT PATCH 

FAfDBG SIRACE L 

SAVE RESUME B RESIOR 

MYSAVE RECALL CONTIN HSTABT 

BU NCOM 

Commands which are supposed to expect a core iaiage are: 

PM IRA STOPAT PATCH 
USE SIAHT 
S AV E HYS AV E 
FAPDBG SIBACB 

(NIL) arguments as commani names, and $ headed lines do 
not alter the saving of a core image. 

As one may n3tice, RUNCOM itself may yield a core 
image, if the last cooiniand in the chain does, e.g., 

LOAD ALPHA BETA 
S AV E Z ET A 
LISIF ZEIA SAVED 
RESTOR ZEIA 

may be used as a macro-conmand, and followed by a START 
coonand. 

Common file switching: 

The only commands which are allowed to begin and 
terminate in different file directories are: 

COMFIL COPY UPDATE REKABK ATTACH 

Indeed, COMFIL switches to whatever directory is 
specified, and the others switch to the user's file 
directory when completed. 

Any other command must be initiated and terminated in 
the same file dicectory. On the other hand, there is 
no restriction en the various switching which may be 
performed during the execution of the commands, as long 
as the initial setting is restored before the end. 

RUHCGM may be initiated in any comicn file, but the 
RUMCOM Command will switch back to its initial file 
directory whenever it needs to load a new set of 
coBtands fcr execution. 

It should be noted that a $ headed line produces a 
major break in the RUNCOM command. The following 
commands in the chain will then be loaded together in 



CTSS EBCGRAMMER'3 GUIDE Section AH. 10.01 12/69 U 

tha supecviS3C's buffers, up to a raaximum of 3 at a 
time. 

Some exauples of lOdicro-coiriiBa nS s: 

We shall assume here that the nana of the BCD file 
containing the chain is MACHO 8UNC0M. 

1. CHAIN FILE (NIL) (END) 
ED FILE MAD 

MAD FILE (NIL) 

(END) FILE ... (LIBE) ... 

may be called in the following ways: 
RUNCOM MACRO FILE 
Whence: ED FILE MAD 
MAD FILE 

BUNCOM MACRO FILE (LIST) 
Whence: ED FILE MAD 

MAD FILE (LIST) 

FUNCOM MACRO FILE (SYMB) VLOAD 
Whence: ED FILE MAD 

MAD FILE (SYMTB) 

VLOAD FILE ... (LIBE) 

2. CHAIN FILE BCD FI Li Nl N2 

♦ THIS MACRO INSERTS THE FILE FILE BCD 

* INTO THE FILE FILl BCD, AFTER LINE NUMBER Nl 

♦ AND DELEPES THE INITIAL PART OF FILl BCD 

* UNTIL AFTER N2. 

SPLIT FILl BCD (A) Nl ♦ N2 (E) 
CHMODE (A) BCD T ( B) BCD T 
COMBIN * FILl BCD (A) FILE (B) 

May be called fcy : 

RUNCOM MACRO ALPA FAP BETA 1030 10U0 

inserts ALPA FAP after line 1C30, and deletes 

until after lOUO 

RUNCOM MACRO ALFA FAP BETA 1030 1030 

same thiny, but does not delete anything from 

BETA FAP 

RUN20M MACRO * FAP BETA 1030 1050 

delates in BETA FAP lines after 1030 until 

after 1050 

3. ♦THIS CHAIN ALLOWS STACKING COKMANDS TYPED ON THE 

♦ CONSOLE, AND THEN STARTS THE EXECUTION 
SPLIT MACRO RUNCOM MACRO N 

♦ N IS THE NUMEEB OF THE LI^E CONTAINING •EXECUTION' 






qar-tirvn ftH- 10-01 1?/6<3 S 



EDIT HACRO RUNCOM 
FILE ttACfiO RUNCOtt 
$ EXECUTION 



(END) 



*-i0 3 t iiijo n «nn en ■ J uuXUii ocCc XOii nii, i<Jm\j£. ti/uj 



li ^ali£.i sa. ti on 

supply arguments in octal to any coaaand 
GENCOM 

Pur£OS3 

If for some reason, the desired arguments foe any command 
cannot be expressed in BCD, the command may be used with the 
arguments expressed as pairs of six-digit octal arguments. 



Usa^e 



GENCOM COHAND ARGU 1 ARGU2 ... ABGUn 

COHAKD is the BCD name of the desired command. 

ABGUi are either the actual BCD arguments of COMAiiD 
or pairs of arguments, OCTLHi OCT RHi (left and 
right half, respectively), which specify the 
octal equivalent of the desired argument. 
Leading zeros in the octal arguments may be 
omitted. Any argument which is pure numeric 
of digits tc 7 must be expressed as OCTLH 
OCTRH. If an OCTLH is not followed by its 
OCIRH, an error comment is printed. 

GENCOH will ccabine the pairs of six-digit octal 
arguments, OCTLHi OCTRHi, into single twelve 
digit octal arguments, ARGi,and will initiate 
the C3Doand. 

COMAND ARG1 ARG2,..ARGn 



(END) 



rT<i<i Dnnr^RA MNPR • (^ 'JlirnR 5i(»r:tion AH-IO-O^i 12/69 1 



Identification 



User subsystem ccntrcl 
SUBSYS 



P uriiosa 



To allow a usee prcgraa (•subsystem*) to have reliable 
control over the manner in which a console user aay interact 
with CTSS. 



Discussion 

Durinj recant years there has evolved on CTSS a class of 
specialized interactive programs best thought of as 
subsystams under 3ISS which, with few exceptions, are 
intended to be usable by persons having little or no 
experience with CTSS as a general-purpose computing 
ficility. Examples of such programs are the various 
information retrieval systems, teaching aids, and the 
crammand interface program '.* . 

In many cases it is desirable (or necessary) that such a 
subsystem be the only access a user has to CTSS, i.e. that 
hi ::an*t guil and then go do something else. This means that 
the tima-sharing supervisor must provide a means whereby the 
subsystem may regain ccntrcl in situations which would 
ordinarily allow the user to issue commands directly to the 
system (e.g. program termination, pushing the QOII button, 
arror conditions, etc.). 

Tha following considerations led to the current 

implementation of the subsystem facility: 

1. Erovide fct subsystem-restricted users, i.e. users whose 
subsystems are initialized at ICGIN and who may not 
accass CTSS except as allowed by the subsystem. (This 
was the principal reason for the implementation of the 
subsystem feature, and is intended to provide better 
control over a user's activities than the old 
*disk -restricted user* facility.) 

2. Allow a subsystem to load and execute programs or 
execute CTSS commands (e.g. £DL) by using command 
chaining, and recover control when execution terminates. 
In the case of restricted users, such programs must not 
ba able to modify the supervisor subsystem status words; 
however, the subsystem need not be so restricted. 

i. Allow a subsystem to intercept a new command typed while 
at command level. Since the QUIT button is the cnly 
real safety valve available when a program has entered 



CTSS PBCGRAMMEH'3 GUIDE Section AH. 10.03 12/69 2 

ail endless loap, and even well-coded subsystems are not 
immmune to proyram buys, it was decided that the best 
way to give CDntrol to the subsysteni after a yuit is to 
wait for a new ccmmand tc be issued from the terminal, 
and then load the subsystem instead of executing the 
comnnand typed. By making the comaand typed at the 
terminal available in the current command buffer, it is 
possible for the subsystem to execute the coimand via 
CHNCOn or NEX30W. 

u. Allow the subsystem to specify conditions under which it 
should be loaded (program call to DEAD or DOBMNT, call 
to CHNCOM with nc ccmmand chaining, intercepting new 
command, error condition) , and allow the subsystem to 
datarmine which of these conditions caused it to be 
loaded . 

b. Allow the subsystem to specify that a SAVED file of a 
possible dormant core image is to be automatically 
produced before loading the subsystem. 

Method 

Six spacial TIA*s have been provided which allow a program 
to specify and examine the conditions under which a 
subsystem is to be loaded. These may only be used by a 
subsysteni or by a subsystem- privileged (i.e. not restricted) 
usar. Hefer to sectian AG. 8. 05 for details. 

Associated with each aser , there are three status words 
maintained in the supervisor containing his standard 
options, his subsystem name, and his subsystem condition 
roia mask and last condition code. 

Usar standard options occupy a half-word (18 bits), and are 
interpreted as fellows; 



user options 



1 Search user UFD first for command 

2 Search user or system files (not both) for command 
U RESETF if command resets dormant prog. 

10 User subsystem trap enabled 

20 Inhibit quit signals for user 

UO Current user program is subsystem 

100 Automatic save before loading subsystem 

200 User is 'dialable* 

The two lew order bits are taken together to specify 
four modes of cammand file searching: 



CTSS PHOfiRAMMER »S r^UTDE S&r:tion AH. 10.01 ■\7/f>'i 



Search systes files then user files (normal mode) 

1 Search user files then system files 

2 Search system files only 

3 Search user files only 

Tha following disk-loaded commands are always taken from 
the system files (provided that the user is allowed to 
US3 them) : 

LOGIN 
LOGO 01 

OTCLOG (user may not issue) 

DAEMON (incremental dumper only) 

DSEUHP (iaccemental dumper only) 

DSLOAD (incremental dumper only) 

FIBMDN (FIB user and FIBKCM only) 

CETION (subsystem-privileged user only) 

Th3 BESETF bit specifies that if there is a dormant core 
image left from the last command, and the command 
currently being processed does not preserve this core 
image (i.e. not SAVE, HXSAVE, START, KSTABT, SUBSYS, 
ENDLCG, BESETF, oc any E-core transfer command: USE, 
DEBUG, PM , etc.), any active files will be reset by a 
call to PESEIF instead of being closed normally. This 
provides compatibility with previous versions of CTSS. 

Tha subsystem trap enable bit causes all program calls 
going to DEAD or DORBHI (including errors) to simulate a 
call to NEXCCB for the command SDBSTS, provided that the 
call does not come from the user's subsystem (option bit 
40 off) , and causes all new commands issued from the 
terminal to pass through the subsystem processor (with 
the exception of exempt commands). 

Tha quit-inhibit bit causes all quit signals to be 
ignored for the user. Program status will be unaffected 
if the user attempts to quit and buffered output will 
not ba reset. H. E. The only way to stop a non- quittable 
program that has gone into a loop is to force an 
automatic logout by hanging up the data- phone (or 
turning off power to the terminal) . Use this feature at 
your own risk ! 

The subsystem execution fcit , if on at command load time, 
causes a new core image being loaded to have subsystem 
privileges if the user does not have the subsystem 
privilege hiraiielf. Program calls going to dead or 
dormant status will execute normally if this bit is on, 
ragardlass of the setting of the subsystem trap bit. 

Tha subsystem save bit if set causes the subsystem 
processor tc simulate a 'nXSAVE progn T' before it loads 
tha subsystem. 



CTSS PROGRAMaEH'S SOIDE Se::tion AH. 10. 03 12/69 



The dial- petmit bit allows remote terminals to attach to 
tha user via the DIAL coaimand. See section AH. 1.05 for 
details. 

The user's subsystem name is interpreted as a six-character 
:;oiBinana naiae, which may he any system ccmiaani or a user 
disk-loaded coniniand (5 AV ED file). 

+ + + + + + + 

I subsystem name | 

+ + + + + ♦ + 

The subsystem conditian code mask is a half-word quantity 
split into two 9-bit fields. The high order 9 bits are 
axaminad by the subsystem processor if the user has a core 
image left; the low order 9 bits are examined if there is 
currently no core image. Within each 9-bit field, the bits 
are interpreted as follovis: 

1 Trap new command 

2 Trap direct program call ('DEAD', •DORHNT') 

U Trap CHNCOM if end of chain or no chain set up 
10 J'rap error condition (file system, EMV, etc.) 

The subsystem condition code occupies the high order 18 bits 
of: th3 subsystem condition mask word. The low order 9 bits 
of these 18 indicate which of the possible subsystem trap 
conditions occurred to cause the sufcsysten processor to be 
entered (zero if the SUBSYS command was issued directly by 
tha usar or his program). The following 8 bits specify an 
error code if the subsystem condition code was 10 ('error')/ 
in ordar to indicate the type of error that occurred. This 
is not yet ifflplemented, and the error code will be returned 
as 0. The high order (sign) bit is on if there was a 
dormant core image left- 

+ + ♦ + — ■• + 

I I error | cede | condition mask | 
♦ + + + + ♦ 

Whan tha CTSS supervisor determines that a user's subsystem 
is to be called in (option bit 10 is on and user is about to 
jo dead or dormant or is at command level and types a 
command), it initiates the special command 'SUBSYS' for the 
usar, in the same way that ENDLOG is set up for an automatic 
logout, placing the user in the queues in waiting command 
status. The SUBSYS command may also be issued by the user 
iiractly, from the terminal or via CHNC3M; this is 
considered to satisfy any condition mask. 

When SUBSYS is entered, the following occurs: 

1. If the user's current core image is not that of his 
subsystem (option bit 40 oft) and the automatic save 



<Zctr, 4-i r\n 4W in HI 1 ') / (^ Q 



option is specified (option bit 100 on), SUBSYS 
simulates a 'MYSAVE progn !• . 

If the SUBSYS command was initiated by the user, either 
fcy typing SUESYS at the teraiinal, or within a coiEiiand 
chain, the subsystem is unconditionally loaded, whether 
or not the current core image belongs to the subsystem. 
The condition code is set to 0. (This is the only way to 
reenter the subsystem if a protection mode violation or 
file system error with nc error return specified occurs 
during execution 3f the subsystem.) 

If the user's current core image is that of his 
subsystem, and the SUBSYS command was initiated by the 
supervisor, the user's program (subsystem) is restarted 
ty simulating the 'STABT' command. If a command line was 
entered and trapped, it will be available in the current 
command buffer. This is the case when a user, while 
executing in the subsystem, quits and tries to issue a 
command, or when the subsystem itself has called DORMNT 
and the user issues a new command. (This occurs only if 
bit 1 of the subsystem mask is on.) 

If tha user's current rore imagp is not that of his 
subsystem and the SUESYS command was initiated by the 
supervisor, SUBSYS conjpares the current subsystem 
condition code with the condition code mask. If any 
condition is satisfied, the user's subsystem is loaded, 
option bit UO is set (this bit on while a coaaand is 
being loaded instructs the command processor to set the 
restriction code bit in the user's current restriction 
code that allows his subsystem to call the TIA 's which 
modify options and subsystem status), and the prcgram is 
started. If none of the conditions are satisfied or 
there is no subsystem set up, SUBSYS exits via COBHMT 
unless a command was trapped, in which case SUBSYS will 
return to the command processor to execute the command. 



Excaptjons 

The following CDmmands when issued from the terminal are not 
subject to being trapped by the subsystem facility, but will 
execute normally: 

SAVE 

MYSAVE 

START 

8 START 

OPTION (restricted user may not use) 

SUBSYS 



CTSS FPCGRAMMER'S GUIDE Section AH. 10.03 12/69 6 



Restriction 



Bswara of attemptiny to use •SUBSYS' 
Results Will be peculiar. 



as a subsystem. 



(END) 



uxS5 PkOGHhKHEk ' 5 3i)IuE Seutiuu AH. iu.v/i» \2./t>:> 



Identif ica ti cn 

Set user options 
DPTIOS 

Purgosa 

Allow a user to set his standard option and subsystem status 
words maintained in the supervisor to modify system 
characteristics to suit his own needs. 

Discussion 

With systems numbered 8A and higher, the comaand processor 
has been conipletely redesigned to provide a raore general 
user interface. 

Associated with each user, there are three status words 

maintained in the supervisor containing his standard 

options, his subsystem name, and his subsystem condition 
::o43 mask and last condition code. 

Usar standard options occupy a half-word |18 bits), and are 
iutarprated as follaws: 

+ + + 

} I user options | 



1 Search user UFC first for command 

2 Search user or system files (not both) for command 
4 BESETF if CDmmand resets dormant prog. 

10 User subsystem trap enabled 

20 Inhibit iixixt signals for user 

4 Current user program is subsystem 

100 Automatic save before loading subsystem 

200 User is 'dialable' 

The two low order bits are taken together to specify 
four modes of coumand file searching: 

Search system files then user files {normal mode) 

1 Search user files then system files 

2 Search system files only 

3 Search user files only 

Tha following disk^loaded commands are always taken from 
the system tiles (provided that tha user is allowed to 
usa them) : 



CTSS PROGHAMMSR'S 3UTDE Saction AH. 10.04 12/69 2 



LOGIN 

LCGCUT 

OTOLOG (user may net issue) 

DAEMON (inccementai dumpec only) 

DSDUMP (incremental dumper only) 

DSLOAC (inccementai duaper only) 

FIBM3N (FIB user and FIBMON only) 

OPTION (subsystem-privileged user only) 

Tha RESEIF bit specifies that if there is a doroant core 
ima^e left fraa the last command, and the conmand 
currently being processed does not preserve this core 
inidge (i.e. not SAVE, MYSAVE, START, RSTABT, SOBSYS, 
ENDLOG, RESEIF, cr any B-core transfer command: USE, 
DEBUG, EM, etc.), any active files will he reset by a 
call to RESETF instead of beinj closed normally. This 
provides compatibility with previous versions of CISS. 

The subsystem trap enable bit causes all program calls 
going to DEAD or DORMNI (including errors) to simulate a 
call to NEXCOM fcr the command SUBSYS, provided that the 
call does not cane from the user's subsystem (option bit 
UO off) , and causes all new commands issued from the 
tarminal to pass through the subsysteai processor (with 
the exception of exeupt commands) . 

The quit-inhibit bit causes all quit signals to be 
ignored for the user. Program status will be unaffected 
if the user atteupts to quit and buffered output nill 
not be reset. N.B. The only way to stop a non -quittable 
program that has gone into a loop is to force an 
automatic logout by hanging up the data-phone (or 
turning off p3wer to the terminal). Use this feature at 
your own risk! 

The subsystem execution bit, if on at command load time, 
causes a new C3re image being loaded to have subsystem 
privileges if the user does not have the subsystem 
privilege hienself . Program calls going to dead or 
dormant status will execute normally if this bit is on, 
regardless of the setting of the subsystem trap bit. 

The subsystem save bit if set causes the subsystem 
processor to simulate a 'MYSAVE progn T' before it loads 
the subsystem. 

The dial-pernsit bit allows remote terminals to attach to 
tha user via the DIAL command. See section AH. 1.05 for 
details. 

The user's subsystem name is interpreted as a six-character 
command name, which may be any system command or a user 
iLsk-loaded command (SAVED file). 



t-i;3:> t puvin Hi'ii'i cicv " J <.3>j±uu .j^^«,iv»»» 



till in nu ^^)/(^Q 



_+ ♦ + — 

sutsystem name 
_<. 4. + — 



The subsystem condition code nii sk is a half-word quantity 
split into two 9-bit fields. The high order 9 bits are 

«., -.»>i«^^ K,. ^v,a onK c: ucl-oin r> r- n" a <; <5n r if thf^ USSr haS a COCe 

image left; the low order 9 tits are exanined if there is 
currently no core image. Within each 9-bit field, the bits 
are interpreted as follows: 

1 Trap new command 

2 Trap direct prcgcam call (•DEAD', •DOHMNT') 

U Trap CHNCOH if end of chain or no chain set up 
10 Trap error condition (file system, PMV, etc.) 

The subsysteB condition code occupies the high order 18 bits 
of the subsystem condition mask word. The low order 9 bits 
of these 18 indicate which of the possible subsystem trap 
conditions occurred to cause the subsystem processor to be 
antarad (zero if the iUBSYS command was issued directly by 
the user or bis prograni) . The following 8 bits specify an 
arror code if the subsystem condition code was 10 {'error') » 
in order to indicate the type of error that occurred. This 
is not yet implemented, and the error code will be returned 
as 0. The high crdier (sign) bit is on if there was a 
lormant core image left. 

+ + + + + + 

I I error | cede | condition mask | 



-+ 



♦ ♦ + * 

Osa3.a 

To turn on option bits: 

OPTION SET nnnnnn 
To turn off option bits: 

OPTION RESET nnnnnn 
To specify all options: 

CPTIGK LCAD nnnnnn 

(whare 'nnnnnn* is the octal representation of the option 
hilf-word) 

To specify subsystem status: 

OPTION SETSYS command nnnnnn 



crSS EBCGBAMMisR'S GUIDE Section AH.10.0U 12/69 U 

(whars 'conimand' is the six-chac acteL or fewer name of the 

command which is the desired subsystem and •nnnnnn • is the 

subsystam conditiDti mask. Option hit 10 is turned on by this 
operation. ) 

To obtain a sumniary cf options and subsystam mask bits: 

OfllON HELP 
To print out current options and subsystem information: 

OPTIGN PRINT 
To find out how to use the command: 

OPTION 
Bjgstriction 

Th3 OPTION command will be 'NOT FOUND. » in the systea files 
for a subsystem- restricted user. For a non-restricted user, 
OPTION is always loaded from the system files, regardless of 
the settings of the command loading options. 

Th3 OPTION ccinaiand will not be trapped by the subsystem 
mechanism for a normal user (i.e. one who is not 
subsystam -rest rioted). 



(END) 



ltSS f HUUKflnntsK • b juiub :3acrion an.ii.ui j/do i 

I^entif icdticn 

Print I/C error diagnostics PRSTEH 

Purpose 

i n 3 r l\ HX ij rv t^ <j III m d II v^ i, ax xi> Cut; r uu j. uu i»u ui. uui.j.iic jnu.-t.uuy wO 

format and the print diagnostic information available from 
tha lODIAG subroutine (also in kG.H.Ob). 

Usa^e 

FaSTEH 

prints one line of the user's console of the form: 
-•I/O'- •ERBOB* n: diagnostic: • — * subr 'AT' userloc 
'(F.S. 'f sloe •) * . 

n = numeric value of file-system error code 

diagnastic = ECC interpretation of • n' 

subr = entry in file-system in which the error 
was discovered. 

userloc = location in user's program or coaiDand of 
call to 'subr*. 

fslcc = location within file-system (F.S.) where 

the error was discovered. (This is 

generally of little interest to user). 

Normal exit via ZHNCOM. 

Alii£a^te UsagLg 

For usar programs and for command chains which contain 
individual commands which cannot continue execution when 
fila -system errors are encountered, the PRMTER command may 
be called upon via the following alternate usage: 

PBNTEB MASK 

MASK = feiMIl argument used to control the 
printout of diagnostic information. Bits 

28-35 correspond exactly to the bit 
positions used in specifying "MASK" to the 
PBNIEB subroutine. In addition, the 

sign- bit (bit 0) controls command chaining: 
if the sign is negative (i.e. 1) control 
passes immediately to CBNCOH ; if the sign 
bit is positive (0) ani the user was within 
a chain of commands, the comment 



CTSS PROGRAMMER'S GUIDE Section AH. 11.01 3/66 



TYPE 'START* TC CCKTINUE CHAIS 

will be printed on the user's console, 

toliJwed by d call to DORMNT, to allow the 

user to take any necessary corrective 

action. Typing START allows the chain to 
proceed via CHNCOM. 

I£ 'MASK' equals (+ or -) , the PRNTER 
subroutine's default mask (375(8)) will be 

used. 

Th3 following examples are equivalent ways of setting up 
this usage froa within a command or user program: 

MAD: EXECUTE NCOM , ($PRNTE R$ , MASK) 

MASK is either a variable or a constant 

denoting the desired binary argument. 

FAP: 

CAL =HPRNlEa (nane of command) 
LDC MASK (argument of command) 
TSX NEXCQn,U (optional TIA =HliEXCOM) 

MASK is either a literal reference {=/)»n') 
or the address of a variable containing 
the desired binary value. 

From the console, the appropriate binary conf iguaration may 
bi -jenarated via GENCOM or via judicious choice of a BCD 
argument. 



(END) 



CTSS usdga 

WHO 

Purgosa 

To deternine who is using CTSS at any given time. 

WHO 

or WHO N 

or WHO P80GN -PROGN- -N- 

Tha name of the current systam and the last time it was 
loaded are printed en the user's console, then the 
number cf users currently logged in, and the current 
time and date. 

Following this is printed the line, problem and 
prograBBer nuaber, line multiplier, console 
idantif icatian number, time used since logging in, and 
login time for each user currently logged in. 

If PHOBM PRCGN are specified, only statistics for PROBN 
PROGN will be printed. * PROG N will print all users 
with prcgraemer number PROG. If PROGN is omitted PROBN 
♦ will be assumed, 

N is an optional parameter giving the time in minutes 
that the program is to 'SLEEP' before again printing 
the number cf users, date and time, and information 
about each user as explained above. However, instead 
of the time of login, tha time used since last print 
out is printed. If M is omitted, control passes to 
CHNCOn. If N was given, this routine may be terminated 
at any time it is 'asleep* by typing a new command. 



(END) 



CTSS ERCGHAMM£R«5 GUIDE Section AH. 11. 03 12/69 1 



liantif ic at iqn 

Listing control 
SPACE, EJECT 

Purpose 

Insert blank lines between commands in a chain, or eject a 

page. 



Osajje 



EJECT -A1 A2 ... An- 
SPACE n -A1 A2 ... An- 



•SPACE n* causes *n* carriage returns to be typed. If 'n' is 
omitted, M* is assumed. EJECT is equivalent to • SPACE 66 • . 
If A1 ... An appear, they will be passed back to the 
supervisor as a command via SETCLS and NEXCDM. 



(END) 



r'rt:Q cnrfiRiMM PR*-; f^riTHF 



5?P.rtion AH-ll-OU 



12/69 1 



Ilantif ication 

Print comoiand line 

ECHO 

Pur£Ose 

To print command line before executing the coniniand. 

ECHO -Al A2 An- 

Tfaa coiBiaand name «ECHO» followed by any argumants will be 
typed on the tetsinal. If Al .,. An appear, they will be 
passed back tc the supervisor as a crommand via SETCLS and 
MEXCOM, 



(END) 



Qor-l-T/^n hH 11 nS 19yfvQ 



liSfi^if ication 

Octal/ decimal conversion 
OCT, DEC 

Purijose 

Allow octal-to-decimal or decimal- to-octal conversion from 
-onuaand level, 

Uaajje 

OCT/DEC nnnnnn -A1 A2 ... An- 

OCT will convert the decimal namber nnnnnn to octal and 
print the result; DEC will convert the octal number nnnnnn 
to decimal and print the result. If A1 ... An appear, they 
will be passed back to the supervisor as a conmand via 
SETCLS and NEXCOH. 



(END) 






Turn priDtec en or off 
PON, POPF 

PurEose 

To engage or disengage the printing element on the terminal. 

Usaja 

PON/POFF -A1 A2 .., An- 

The printer is turned en or off as specified. Note that 

output is always printed in the case of a laodel 35 teletype; 

only input printing is affected by POFF. If Al ... An 

ippaar, they will be passed tack to the supervisor as a 
command via SETCLS and NEXCOH. 



(END) 



C^SS ESCGHiSHEH'S GUIDE Section AH- 11-07 12/69 1 

li^ntif icaticn 

Change ribbon shift 
RED, BLACK 

Purpose 

Changa ribbon colar setting on 1050 or 27U1 terminal. 

Usa^e_ 

FED/BLACK -Al A2 An- 

Tha ribbon shift if any on the terminal is set to the 
desired setting. Note that input typed on a 27U1 after 
sattiny ribbon shift to red will print black, whereas on a 
1050 the ribbon setting is permanent. If Al ... An appear, 
they will be passed back to the supervisor as a command via 
SKTCLS and NEXCOM. 



(END) 



rT*?*; ccranaMMPRt^ niTTrs 



^ orf inn a H 1 1 Oft 



19 yfiq 



liantif icatjon 

Command chain checkpoint 
YES 

Pur^jose 

Print a response on the terminal, generally between commands 
in a chain or at the end of a chain. 



U^^^ije 



YES -AT A2 ... An- 



An asterisk {'**) is typed on the terminal. If A1 ... An 
appear, they will be passed back to the supervisor as a 
3omsand via SETCLS and NEXCOM. 



(END) 



CTSS FPCGBAMMF.R'S ntJIDE S faction AH^II.O*? 12/69 1 

Pause between CDmin<inds 
WAIT 

Purpose 

Pause in execution for specified time 

ysa_<je 

WAIT n -A1 A2 ... An- 

The contmand will sleep for 'n' seconds, than exit. If A1 

... An appear, they will be passed back to the supervisor as 
a command via SEICLS and NeXCOW. 



(END) 



" " " " — " I ^/ <j y 



JJLSStif ication 

Print date and time 
TIME 

Par£osa_ 

Print data and time on terminal 

Usa^e 

TIME -A1 A2 ... An- 
Tha current date and time will be printed in the form 

Mfl/ED/YY HH:MW:SS 

IE A1 ... An appear, they will be passed back to the 
supervisor as a command via SETCLS and NEXCOM. 



(END) 



I ^ / V J I 



Identif icatiOiP 

Explain file error code 
PEHROH 

Purpose 

To allow the user to 3btain a diagnostic message explaining 
a file system error at a time other than imniediatel y after 
the error occurs. 

Usacje 

FEEBOR ENIBY ERCOCf -lOCODE- 

A iiajnostic messaye 3f the same form as generated by the 
PHMTER coBirand (see AH. 11.01) will result, for error 
•ERCODE' in call to file system entry 'ENTRY'. If • EHCODE' 
is tha arrcr cede far I/O error, the diagnostic will be for 
I/O error 'lOCODE' in call tc 'ENTRY'. 

Exaffl£la 

PEHROR WHFILR 8 S 
This comirand will result in the message: 

ERROR 5: TLLE3AL I/O REQUEST FCF DEVICE — HRFILE 



(END) 






t;/*.*; 



Public File Subrcatines 



This section of the manual contains the documentation of 
usar-subiBittsd subcoatines in the Public File, These 

routines must, of course, be loaded along with the frograms 
which call thero. The general procedure for this is: 

LINK NAMEI BSS M1416 CWFLOU 

(This need only be done once, of course.) Then, for 

3 xampla , 

LOADGO PROS NAMI1 

where PRCG is the first name of a BSS file containing a 
program which calls a subroutine (or subroutines) contained 
in file KAME1 ESS. 

Ths nature of the Public File and the procedure for entering 
programs in it are discussed in Section AD. a. 



(END) 






Identification 

MADIO 

Simplified i/o package for MAD programs 

Reference: MC-M-270 

Pa tar J. Denning 

Pur£OS3 

HADIO is designed for use in the CISS environment as a 
compact input-output package. Its reading facility features 
format free reading within one simple call. Its print 

Eiwility incorporates the most commonly used HAD-type format 
specifications, a simplification of Hollerith field 
specifications, and the facility to print without carriage 
r;»turns. A program may read from the console by means of a 
single call to READ, and print on the console with a call to 
PHINT. These calls ace intended to replace the use of the 
HEAD F3HMAT and PRINl FORHAT Statements. MADIO is about 

(2400) B locations long, half the size of the CTSS package, 
(TDH). Unlike (lOH) , HADIO does not use program common ;{ 
thus, it can be used in conjunction with the NCLCAD command, 
which can lead to very ccmpact 'SAVED* files. 

MADIO can ba obtained by linking to 'MADIO BSS* in Miai6 
C^IFLOU. 'READ* cr 'PRINT' may be extracted from 'MACTC ESS' 
by means of the 'EXrESS' command. 

lORMAr FREE READIBG 
PE23£SS Mage; READ. 

Transfer Vector: RDFLX, fc'HFLX, iHFLXA. 
Use; The call is: 

READ. (A, B, ...,L) 

whare A,fi,...,X. is the list of naaes into which values are 
to be read. Any or all of then may be in MAD block 
notation, i.e., A(J)...A(K), provided K is greater than J, 
and multiply-subscripted arrays are peraissible. There is 
no restriction on the length of the list A,B,...,L. 

The call to READ puts the user into input wait status under 
control of the BEAD prograa. The READ program counts the 
number of locations specified by the list A,E,...,L, 
including arrays. If there is any discrepancy between this 
count and the number of locations required for the items 
typed on the console, an error condition results (see 
below). 

The user types a line of the form 



crss EFCGBAMMER'5 GUIDE Section AI.2.01 9/66 



IT EMI IT EM 2 ... ITEMn 

Eic;h it3in is a data field, and one or more spaces separate 
edch iteir. 

(1) If 'ITEMi* is a string of digits containing no 
dacimal point, it is interpreted to be an integer. 
It nay be preceded by a •- ' or an (optional) '+' 
sign. 

(2) If 'ITEMi^ is a string of digits including a decicaal 
point the number is interpreted as floating foint. 

(J) If 'ITEMi* is a string of digits 0-7 follo«ed by a 
'K', the string is interpreted as octal - 

(4) If 'ITEMi* is a string containing BCD characters 
other than the digits 0-9, •♦•, • -• , • K« , •.» or »,« 

it is interpreted as a hollerith string. A 

hollerith string is entered six characters per 
mamory location, the contents of the final location 
left adjusted with trailing blanks. 

(5) If 'ITEMi' is to be a hollerith string containing 
spaces then it is enclosed in dollar signs, •$». If 
the final '$• is missing, the end of the line, which 
is assummed t3 be after the Tith word, is taken to 
ba the end of the string. Thus an entire line can 
be read into a 14-word buffer by starting the line 
with •$'. The •$• is ignored so that in actuality 
83 characters ace read in, with a blank inserted as 
the Sith character. 

(6) Number items and hollerith items nay be mixed in any 
way on the line. 

(7) If all the names A,B,...,L would require more than 
one line ot typing (i.e., mora than 8U characters 
are needed) as many items as desired nay be entered 
on a line and remaining items entered in succeeding 
lines. The program gives the following comuent: 

*****TypE k MORE ITEMS. 

where k is the number of remaining memory locations 
to be filled (called for • by the list A,B,...,L). 
Hence the n argunents of the list could be entered 
on as many as n console lines if desired. 

M§trictions: 

(1) No more than 36 items or 84 characters to a line, 
whichever comes first. 



CTSS PFGGBA. MME H*3 G'JIDl Section AI.2.01 9 '66 



(2) So more than 12 digits to a number. Integers may 
not exceed in uagnitude 2. P. 36. If X.Y is a 
floating point number then the integer XY must not 
exceed 2. P. 27. This latter restriction can be 
lifted if demand dictates. 



ll£2£ Conditions . 

(1) If the number of arguments typed is less than the 
number of arguments in the list A,B,...,L then the 
following comment is printed: 

♦ ♦♦♦♦YOU HAVE k IXIRA HEMS, DO YOU WANT TO IGNORE THEM, 

If • yes • is typed the extra arguments are ignored, 
otherwise the program reguests that the present line 
be retyped. 

(2) If more than 12 digits in a number, READ reguests 
retyping the line. If a comma appears in a string 
of digits, it is assumed to be a mis-typed decimal 
point and retyping is reguested. 

<3) ether miscellaneous errors are caught, and the 
following comment is printed: 

*****ESROfi AT ITEM NC. k. RETYPE LINE, 
Sfiecial Calls tc BEAE: 



(1 ) Th3 call 
or. 



SEAD.($.TEXT.$,A,B,... ,L) 

READ.(T,A,B,,.. ,1) 

VECTOR VALUES T = $.TBXT.$ 



Causes READ to read onli ii a BCD mode into the list 
A,B,...,L. This would be particularly useful for 
reading into a buffer: 

READ. (J.IEXr.J, BUFF{ 1) ...BUFF(N) ) 

If N is greater than 14, the remaining words may be 
entered on succeeding lines, as described above. When 
READ is called, and the first location in the calling 
seguence, 1, contains the string ".TEXT,", READ enters 
BCD mode and ignores I. Hence the first item typed is 
entered into A, the second into B, etc. 
Caution: Be careful of a situation like 

READ. (A,B, .. .,L) 



CTSS EPCGRAKM£R«3 GUIDE Section AI.2.01 9/66 4 

if you should enter the word ".TEXT." into A, the next 
call of this fotB may still have ".TEXT." in A; then the 
items typed will be treated as BCD and entered into 
B,...,L instead of A,B,...,L as intended. 

(2) The nessage 

♦ ♦♦♦♦■jYPE k MORE ITECS. 

may occur frequently and may be annoying. The call 

READ. ($.OFF,$) 

will cause the program to enter a mode in which this 
massage is suppressed. The call 

REAE. ($.0N.$) 

will reset to nortnal mode. Suppose the list A,B,...,L 
calls for M ireniory locations to be filled, the REAE 
program is operating in Off-mode, and the items typed 
would fill N locations. The remaining (M-N) locations 
will be filled with zeros. In the CFF-mode, only one 
line of type is accepted. 

NOTE. Tha BEAD FORMAT statement, if used, will cause 
incorporation of the standard CTSS input-output package at 
loading tipe, perhaps defeating the usefulness of the READ 
program. 



CONSOLJ PRIHTING 

EEOlEit liaa.6: PRINT. 

Transfer Vector: WRFLX, RHPLXA, RDFLX, EXIT. 

Usa: The call is: 

PRINT. (FM'I,A ,B,... ,L) 

where FMT is a format statement, and A,B,...,L is the list 
of namas to be printed according to FMT. No restriction is 
placed on the lergth of the list. Any of the names in the 
list may be in block notation, i.e., A{J),..A(K), provided K 
greater than J. Multiply-subscripted arrays are permitted. 

FST is a HAD- type format statement enclosed in dollar signs 
of th3 form: 



VECIOR VALUES FMT=$ ... ♦$ 
or, 

VECTOa VALUES ?«! = $ ... N*$ (See below.) 

If FMT specifies format for k locations and the naae list 
sp3::ities altogether m locations, with k^m, then the minimum 

Of- U ^nH n> 1r*/^;^4'TO'^«^ -* m^^ i% r^ -^ im> 1 1 %i rw i r% ^ ^ A c^-^^^u -c^-c^i^ 

specification is separated by a space or comma as desired. 
S£i.5.ii.l Features 

(1) It is no longer necessary to use H-formats. Hollerith 
strings are simply enclosed in parentheses, and no 
letter 'H« is used. However, since •) • is used to 
terminate a string, the convention •=)' is used to 
i.O.§§.£l *)' into the output string, the »=' sign being 
ignored. To insert '=)• into the string, use •==)'. 
Examjgle. The format statement 

VfiCrOB VALUES FMT=$ (HOLLER IT H STRING. )*$ 

results in 

HOLLERITH STRING. 

beinj printed. Also, 

VECIOR VALUES FHi:=$ (ARRAY () ,13 ,(=)) *$ 

results in 

ABBAT ( k ) 

being printed, where k is the value of an integer 
variable named in the list. 

(2) It is possible tc print nithout a carriage return. The 
format statement is terminated with •»♦* instead of •*• 

(N = no return). This can be particularly useful for 
entering data into programs by means of single-line 
questions and answers. 
Example. The format statement 

VBCrOB VilUES FMr=;g(DO YOU BANT f!ORE,)N*$ 

results in 

DO YOO MAMT MORE, 

being printed without a carriage return. 

( .1) If an illegal format or soma other error condition 
arises, the FRIMT program gives an error description- 
Then it will allow the user to return to the calling 



CTSS EPCGSAMMER'S GUIDE Section AI.2.01 9/66 



program if he desires. With this feature, execution of 
a provjrair need net be halted by a format error, as is 
normal in CISS. 



fH Mo E-forraats are allowed, 

(2) Integers must be less than 2. P. 36 in magnitude. 

(J) If X.Y is d floating point number then the integer 
XY must be less than 2. P. 36. 

(4) All C-foriaats are interpreted as C6. 

(5) Only cne level of nesting is allowed. Thus 
5 (6F8.2,S2, 15/) is allowed in the foroat statement, 
tut not 5(6(F8.2) ,S2,I5/) or 3 (F8. 2 ,2 (15 ,S1 , C6) ) , 

(6) Ot course use of the PRIST FOKMAT statement defeats 
the use of PBINT. 



( 1) Illegal'tyrmat results in the following: 

♦♦♦♦♦TBOUBLE AT FORMAT WORD *word'. 

*****PRBSENr LINE IS.. 

««««« (output line up to error) 

*****D0 YOU WANT TO BETURN TO CALLING PROGRAM, 

If 'yes* is typed, control is returned to calling 
program. Otherwise 'EXIT' is called. Note that 

with this feature, execution of a program is not 
halted by illegal format, as with regular CiSS 
library programs. 

(2) Sumber exceeds specified field width. Signs and 

decinal points are included in the field width. 
Suppose the specified field width is w, and the 
number to be printed contains x digits, where x is 
larger than w. The rightmost (w-1 ) digits of the 
number are printed, and an asterisk (* ) is inserted 
at the left cf the field- For example, suppose the 
format F5.2 is given and the number 1234,5 is to be 
printed. Since the number is too wide for the 
field, the following is actually printed: 

*3a. 5 



(END) 



1 'J / £. Q i 



public file conipands 

This secticn c£ the CTSS Programmer's Guide documents 
usar-supplied programs which are analagous to systeni 
commands. They are Biintained as SAVED files, accessible 
through the public file directory «im6 CKFLOU. 

Iha public commands may be used by commands of the form: 

DC F NAME /SRGI AHG2 ... 
Altarnativel y, one may link to the SAVED file, 

LINK NAHE SAVED Mlai6 CBPLOU 

and thareafter initiate the program with •RESUME* or 'DO 0«, 
or, with option bit •2' set, use the link as a 'user 
command' (see AH. 10. 04 about the OPTION coDimand) : 

NAME ABG1 ARG2 



(END) 



Ciao r Bv»\3 n«nn Eiix ■ 3 vjU t li c oriwuiUii hJ m£.»\ii. ^/o& 



13 en tifi cation 

GPM - A General Purpose Macrogenera tor 
Christopher Strachey 

Purpose 

This fflacrogenerator is an on-line symbol string processor, 
both its input and its output being strings of symbols. It 
operates by a foLm of substitution which is completely 
g^n^ral in its application, in that substitution is allowed 
anywhere. The result is a powerful system including such 
f3atur3s as recursive functions and conditional expressions, 
which can be in pie men ted with very few (but very 
rabarbative) instructions. 

Raf arence 

C. Strachey, "A General Purpose Macrogenerator , " The 
Comgutar Journal, Vol. 8, No. 3, pp 225-24 1, October, 1965. 
(A limited number of xerox copies are available in the 
Project MAC Library.) 

Usa^e 

RESUME 3PM 

notifications 

All input/cutput in 3PM is in 12-bit mode. Within 
■acro-names, however, only the last 6 bits are 
effective, so that the name "defs" is equivalent 
to "deFS" . The following symbols are substituted 
in the MAC implementation for the corresponding 
synbols in the reference: 



substitute 


$ 


for 


s 


n 


» 


II 


*V 


li 


•> 

« 


w 


Q 


M 


( 


•I 


< 


M 


) 


« 


> 



The syabol | is used to indicate a continued line. 
Return to the system for GPM is accomplished by 
the input symbol \, via an unmatched > as in the 
reference . 

B- Machine Macros 

Four machine macros have been introduced into the 
MAC implementation which do not appear in the 
reference : 

$LOSE, name; 



CrSS FBCGBAMM£R»3 GUIDE Section AJ.2.02 2/66 2 



This tnaccD causes the most recent definition of 
the macro- Dd Be "name'* to be excised from the 
definition chain. 

$ESS; 

This !nacr3 causes the current size of the stack to 
be output. (The maximum allowatle stack size is 
5, ceo.) 

$BEAD, name; 

This macro switches the macrogenerator input from 
keyboard to the file name (memo). 

1) If the file "name (memo)" does not exist, the 
result is a return to the uiacrogenerator via a 
ffcnitcr call, 

2) Occurence of the READ macro within a memo file is 
prohibited and results in a monitct call, after 
which reading of the original file resumes. Input 
returns to the keyboard when the reading of a file 
is completed, 

SUMSTRIMG, arg; 

This aactj insects commas tetween the characters 
in the string referred to by "arg". 

C . Mejc_F i les 

Memo files are created and edited by TYPSET. 
Conflict between symbol conventions in typset and 
the macrogener ator language must be avoided by 
beginning TYPSET with the commands 

ERASE " 
KILL ? 

which establish the erase and kill conventions of 
the macrogenr ator . 

Two public memo files have been prepared for the 
convenience of mac rogenera tor users: 

1) File DBFS (MEMO) contains certain standard 
macrodefinit ions for loading onto the stack. 

2) Additional information about the current 
state of the macrogenerator language, 
including such data as a list ot the macros 
defined in CEPS, may be obtained by linking 
to tile GPMINF (MEMO). 



(END) 



r-re:*; ooncna mmrb « <; r:nTnp -^ar-tiMn ».i "? ni ^/fif> 



I^^ntif icaticn 

Solution of eguilibriam field problems 
EPS SAVED 
C. Tillman 

Purpose 

EPS is a conscle- oriented systei intended priaarily for the 
solution of equilibrium field ( boundary- value) prcblenis in 
trfo- dimensional continua, I a pie mentation of this system has 
rsquirad developing extensive algebraic and input-output 
capabilities. Thus, while EPS does not have the generality 
of a complete progr aoming system, it does provide a facility 
of considerable power and flexibility for on-line algebraic 
mi numerical manipulations. Consequently, it may be 

appliad to probleis quite unrelated to those for which it 
was specifically designed. 

Description 

EPS traats systems of simultaneous, second-order partial 
differential equations by the method of finite differences. 
Th^se equations are assumed to fce r epresentable in a 
standard linear form; bonever, since the coefficients for 
this standard form may be expressed not only as functions of 
position but also as functions of the unknown field and its 
larivatives, it is possible to use EPS in an iterative 
fashion to solve certain nonlinear problems. 

Since the progran obtains solutions by a finite- difference 
technique, problem definition ceguices specification of a 
finite-difference lattice. An important feature of EPS is 
that it permits use cf irregular difference lattices, so 
lattica points may be precisely placed along boundary 
contours and may be concentrated in regions of special 
concern. Moreover, the positions of lattice points, even 
those on boundaries, may easily be caused to change during 
the solution process; thus, e.g., protleiBS involving free 
boundaries may be treated. 

Organization of EPS resembles that of CTSS in the sense that 
users cause various tasks to be performed by issuing 
commands followed by argument strings. However, unlike 

CTSS, EPS scans input in a manner similar to that employed 
by format-free compilers. Thus one may type several 

commands on a single line or continue a long command from 
one line to the next with complete freedos. It follows that 
a simple carriage return cannot be used with EPS to signal 
an "end of message". Bather, the user must denote the end 
of a command or sequence of commands by typing a "$" just 
before his final carriage return. Typical input lines for 
EPS are: 



CTSS PHOGRAMBER'S 3 UIDE 



Saction AJ.2.03 



3/fa6 



DEFINE r=SQRT (x*x + y*y ) $ 
SEI x=3, y=U PRINT r$ 

EPS currently recagnizes twenty coamands. These include the 
commands "APPEND", "DELETE", «CLCSE'« and "IMPOSE" for 
ias-ribinj boandaries and boundary conditions, the conmands 
"DEFINE" and "SET" fcr parameter specification, the commands 
"TALLY", "FORM" and "BELAX" for initiation of various 
specialized numerical procedures, plus "PEINT", "REVIEW", 
♦♦LIST" and "EXPAND" t3r inspection of results or past input. 



Rsf arance 

A discussion of EPS coicaiands and usage conventions loay 
found in MAC-M-28U, which may serve as a rudimentary user's 



mat 



i. Further information and help in usiny EPS 



be 
•s 

may be 



obtained from the author. 

Usaie 

RESUME EPS 

Attar the CTSS W(ait) line, the message •fROCEED:' will be 
typed on the user's console. A command or sequence of 

commands may then be issued. Some commands ptoduce output 
r3spons3s and some do not (most do) ; the user will, at any 
rate, be made aware of return of control to the EPS 
suparvisor by a recurrence of the 'PROCEED:' message. More 
commands may be issued at this time — and so on. 



(END) 






Compress oc expand BCD files 
SgZBCD SAVED, PAEBCD SAVED 
B. Wolman 



pnrriQsa 



To coapcass card_imaje (not liue-macked) BCD files by 
tamoving blanks in arder to decrease track usage, and to 
expand ccmpressed files. 

Usa^e 

To compress file "ALPHA EEIA* into file »GAHttA DELTA*: 

R SQZBCD ALPHA BBTA GAMMA DELTA 
To axpand file 'ALPHA tETA' into file 'GAMMA DELTA': 

R EADBCD ALPHA BETA GAMMA DELTA 

If DELTA is omitted, GAMMA BETA will be created. If GAMMA 

is disc emitted, a new ALPHA BETA will be written. 

aider copies of the output file (GAMffA DELTA) will be 
a3l3t3d by a call to the library subroutine DELETE. 

PADbCD SAVED may be used to expand files which were 
compressed using SQZECD. 



(END) 






I d e n t i f i c a t_i_c n 

Text display on ES L console 
DISPLY SAVED 
H. Murray 

Pur£ose 

To display text en the ESL console (sacond floor, Euilding 

Usa^e 

RES U HE DISPLY SfiMEl N AM E2 -LINE- 

NAMEl NAttE2 is the CTSS name of the file to be displayed. 

LINE is the line natnber the picture is tc begin 
with (if other than 1) . 

PUSH-BUrrOH 8 EXIT BUT SAVE PICTURE 

9 TO 'TURN* PAGE 

10 TO FIMD LINE 

11 TO EXIT FBCM FROGBAK 

12 TO START OVER 

Pl.scriEtion 

Typing "RESUME DISPLY liAMEl NAME2'' will cause the first 
"page" of the file to appear on the screen next to the 
teletype. Any file may be displayed. Line-marked files 

will be displayed with one record on each line, as with the 
PRINT coumand. A file that is not text (e.g. BSS, SAVED) 
will be displayed with each word in the file interpreted as 
BCD. 

Errors result in self-explanatory comments and calls to 
DDRMNT, 

Push-button number 9 on the console is used to step the 
program to the next page of text. 

Push-button number 10 will command the program to find the 
line having the seguence nuratet equal to or greater than the 
number in the decimal switches (above the toggle switch 
ragistars). 

Push-button number 12 will start over at the beginning of 
the file. 

gfaen finished with the program, push-button 11 will sign off 
from tha kludge and return control to the user via CHNCCM. 
push-button 8 also sends control to CHNCOM, but it causes 
tha current picture f) be retained- 



CTSS PROGRAMMER'S :".UIDE 



Sac ti on AJ . 5. 02 



3/66 



If called with nc argutDents DISPLY signs off trom the kludge 
and raturns via CHNCOM. If called with the single argument 
•1' DISFLY signs the user onto one console and then goes to 
CHNCOM . 



(END) 






List links in a file directory 
LSTLNK SAVED 
C. Garman 

PuL'Dose 

LSTLNK will print a summary of the linkage information for 
some or all of the links in a file directory. The 
information printed is the link name, the directory in which 
the file resides, the mode, and the actual name if different 
from tha link name. 

ysa^a 

R LSTLNK -CF- -USE- -OPT- -NAKEl- -NAMB2- 

CF may be used to specify common file switching 
and is of the form • (SYS)* or • (CFLn)* where 
n is any digit or •?•. '(SYS) • and • (CFLP) • 
are synonymous and mean TSSFIL or nl416 
CMFLO^i. The original common file switch is 
restored tefore termination of the coomand. 

USE comprises three agruments which may specify a 
file (e.g., a link to another user's U.F.D.) 
to be searched instead of the current U.F.D, 
(FILE) and is of the form * (USE)' NAME3 
NAME 4. 

GFl if specified, may be either • (TO)' or 

•(NAME)', and modifies the effect of NAME1 
and NANE2, below. 

NAME1 NAME2 specify files, directories or alternate names 
(compare with LNAHEi in AH. 5. 01) used to 
select the links to be printed: if OPT is 
null, the NAMli refer to file names in the 
directory being searched; if CPT is '(TO)', 
then links pointing to files in the directory 
whose PflOBNO PROGNO are expressed by NAMEl 
NAME2 will be printed; and finally, if OPT is 
• (MANE) ', then the NAHSi refer to the names 
in the 'target' directory. Examples: 

a LSTLHK A B 

lists a link in the current directory, 

B LSTLNK (HAKE) A B 

lists a link which is named A fi in the 

directDry in which the file resides. 



CTSS PaOGRA««E8«S GIjIDE Section AJ.5.03 7/66 2 

8 LSTLNK (TO) T0999 9876 

lists all links which point to files which 
reside in directory 1999 9876. 

For aach link encountered, the following infotBaticn is 
pr int ed: 

NAME1 SAME2 PROBN PHC3N MODE -IiAME3- -NAMEU- 

PttOBN PHOGN is the file directory in which the file (or 
further link) resides. 

MODE is 3 octal digit file mode. 

NAHE3 NAME4 is the name of the fila in PPCBN PRCGN, if 
different from NAMEl NAME2. It NAME3 is the 
same as NAME1 , NAME3 is printed as a sing^le 
equals sign ( = ) . If NAMEU is the same as 
HAME2, only NAME3 is printed. 

£^str ictions 

Orlar of optional arguments when more than one are used must 
be as given in the general calling sequence line, above. 
Whan using the • (TO) • option, problem numbers must contain 
four digits, the first of which is zero (0). E.g., T0999, 
not T999. 

Errors: 

INVALID ARGUHENIS OF '(USB) •- 

fance found for either NAMES or NAME^ 

•LIMK(S) NOT FOUND* 

specified links not contained in directory. 

•U.F.B. 100 LONG' . 

entire file directory cculd not be read into available 
memory, most likely by mis-application of '(USE)'. 
Saarch will continue on contents as read. 

file system errors - various; result in call tc PRNTER 
comitand . 



(END) 



rTSS PROCHAMMFR •-; r;iITr)F: SPrrt-inn A.l-R-OU '^/ftfi 



I den t i| ica t i c n 

Print fila directary in octal 
OCTLF SAVED 
H. I. Morris 

Pur£osa 

OCTLF will print all seven wcrds of file directory entry (s) 
in octal. Two lines are printed for eacb entry. The first 
contains the file name in BCE followed by the file name in 
o::tal. The remaining five words of the file directory entry 
are printed in octal on the second line. This routine is 
useful when the exact contents of a U.P.D. entry must be 
da tarmined. 

Usajge 

R OCTLF -CF- -USE- -NAMHl- -NAME2- 

CF is used to indicate common file switching. It 
is of the form '(CFLn) • where 'n ' may be a 
single digit or the letter • F' to indicate 

n\^^h cmfl04. 

USE consists of three parameters which specify a 
file directory to be listed in place of the 
user's 'U.F. D. (FILE)'. It is of the fora 
• («SE) • FMAMl FNAM2, where FNAMi, FNA«2 are 
the primary and secondary names of a link to 
the 'U.F.D- FILE' of the other file directory. 

NAttEl NABE2 specify the file name(s) to be listed. If 

both are omitted , the complete file directory 
is printed. If either parameter is an 

asterisk (•♦•) , all files of given primary or 
secondary name are listed. If NAME2 is 

omitted, '♦* is assumed. 



(END) 



CT53 FHOGRAnnES'S 3 uIDE Scj^-uXun AJ.^.OO •i/Gb 



Print list of files en file system tape. 
TAPLF SAVED 
H. I. Morris 

^u r *^os e 

TAPLF will print a listing of all tape files in a usee's 
aic3ctory. for each file, it will print the file nase, the 
number of records, the logical unit of the tape file, and 
tha physical file number. This program is quite useful to 
those who regularly use file system tapes. 

Osaja 

R TAPLF -:F- -use- -NAflEI- -NAI1E2- 

CF is used tc indicate common file switching. 
It is of the form ' (CFLn)' where 'n • may be a 
siagle digit or the letter *P' to indicate 
public file (Miai6 CMFLOU). 

USE consists of threa parameters which specify a 
file tD be treated as a file directory to be 
listed in place of the user's U.F.E. (FILE). 
It is Df the form "• (USE)' FNAMi FNAM2", 

where FNAMI FHAM2 is the name of the file to 
be used. This tactic is used to list files 
in another user 's directory by reading 
through the link FNAMl FNAJ*2 to that user's 
U.F. D. (FILE). 

NAME1 MAME2 specify the file name(s) tc be listed. If 

both are emitted, all tape files are listed. 
If either parameter is •*', all files of 
given primary or secondary name are listed. 
If NAME2 is omitted, •*• is assumed. 

Raf a ranees 

Section Name 

AG. 5. 05 Use of tapes in foreground 

AH. 3. 06 Tape-handling commands 



(END) 






j^ggtif icaticn 

Convert 6-bit to 12-bit files 
b'rol2 SAVED 
J. H. Saltzer 

Puroose 

To convart a card image file to (MEMO) form, for use with 
the RUNOFF coaniand. 

Usa^e 

RESUME 6X0 12 M AM E 1 NAME2 NAMES 

NAHE1 liAME2 is the name of a card-image file to be 
converted to 12-bit line-marked format. 

SABE3 is the primary name to be used for the 

resulting output file. If NAMES is emitted, 

NAME1 will be used. The secondary name of 
tha output file is always tMEK(?). 

The resulting 12-bit line-marked file may fce edited with 
TYPSET or inserted into an already typed memo in at least 
two ways. The '.append' request of RUNOFF may be used, or 
the files may be combined by using the non-sequencing option 
of tha CCMBIN comniand. 



(END) 






Combine line-marked files 
APPEND SAVED 
C. Garman 



To combine line- marked files so that they can be printed by 
off-line request processing. 

Usaie 

APPEND NAME1 NAME2 NAME3i NAHE4i ... NABE3n NAKlUn 

NAME1 NAME2 is the name of the file to be created by 
combining the files NAME3i NAMEfii ... NAMEBn 
NAMEUn. 

APPEND is used tc prepare a single line-marked file 
for off-line printing by use of a PRINT 
ccntrcl card. if file MAMEl NAHE2 does not 
exist, it will be created (mode '?'){ 
otherwise the file will be added to by using 
♦ .APEND*. 

The files 'NAMEBi NAWEUiMThe files MAME3i HAMEUi will be 
separated from each other in the combined file by a 
program-control page skip, identifying the file. 

Lina-marked files will be copied line-by-line{ files which 
are not line- narked are assuaed to be lU-word card images, 
and will be copied with a full word of blanks added at the 
beginning of the line, fcr single space program control. 

If any of the NAME3i or NAHEUe are •♦' (single wasterisk) , 
tha corresponding NABE3i-l or SAHEi*i-1 will be used. NAME! 
NAME2 may not be appended to itself. 

EXAMPLE: (assume that AECXYZ FAP has been assembled with 

(LIST) ) 

APPEND OUTPai ECD ABCXYZ * ♦ FAP » SYMTB 

which is equivalent to: 

APPEND OUTPUT BCD ABCXYZ BCD ABCXYZ FAP ABCXYZ SYMTB 

If all the names of the files the user wishes to append will 
not fit on one line, the user may type: 

START NAME1 MAME2 BAHE3i NAMEUi ... etc. 

after the 'READY* from the systen{ or if NAKE1 NAME2 is the 
sima, he need only type: 



CTSS PROGRAMMER'S 3 UIDR 



Section AJ.6.02 



8/65 



SIARI * HAME3i NAME4i 



In either of the last two cases •*« for NAHE3i or NftfJEUi 
rafars to the last NAME3 or NAKE4 on the previous lice. 



All calls to system disc subroutines have been provided with 

the appropriate error returns, which all return to the 

system via •CHNCCM*. If the user provides 

only NAME1, the conment »I»COaHEC'r FORKAT' 

In ::ase the comaiand list was truncated, 

NAME3i without its fcllowing MAHB«i, the 

IGNORED' will be printed. 



no arguKents, or 

will be printed. 

or there was a 

comment 'NAHE3i 



(END) 



nvcc c Dnr? D k MM CD t :: r!riTr'vir 



C *:iy^V -1 i^ 1^ ST 



n -a 



-/ / KJ J 



IJ.sntifi cation 

Enciphering, deciphering of files 
GARBLE: ENCIPH SAVEE, CiCIPfl SAVED 
R. Fenichel, D. Edwards 



PucDosa 

In order to provide 
GARBLE will scramble 
filas by using a key 
elsewhere within the 

Mathod 



added security or locks for files, 
and unscramble (encipher and decipher) 
word which is not necessarily stored 
system. 



GARBLE accepts a nessage fron the user, and initiaizes a 
random- number generator with a value computed froa the 
characters of the message. A new randos number is then 
added to or subtracted from each character of the file, as 
it is baing enciphered or deciphered, respectively. 

The user had bettet reirieirber the keys which he has used - no 
one el33 will. Also, it is poor cryptographic practice to 
use any given key on more than one file. 



Usa^e 



E ENCIPH NAME1 NAME2 -NABE3 HAME4- 

R DECIPH NAME1 NAME2 -NAME3- -MAMEU- 



to transform NAME1 NAHE2 into NAHE3 NAflEU. If NAME3 is 

omitted, it is taken as NAME1{ if NAHEU is omitted, it is 
taken as (IAME2. 



ENCIPH creates a file in PRIVATE, PROTECTED «ode{ 
creates a file in PERMANENT mode. 



DECIPH 



Timing 

About 2 seconds/record, 



(END) 



rnrio omiMPDis r:n T p P Sprtinn A.l-fi.OU 12/69 1 

K V \J \M MA n ^* H *■* ^\ '^ V* **-••*•- — ___ ._- _--- 



Jiaaiificdtion 

Compara two files 
CHPARE 

Purpose 

To perform a word-by-iiocd comparison of two files. 

ysa^e 

CMP&RE NAME! N AM E2 N AM E3 -KAME4- 

If NAME4 is OBitted, it is assumed the sane as HAHE2. If 

the twc files are identical, the message 'FILES ABE 
IDENTICAL.* is printed. If the two files are not identical, 
a line is printed for each word that is not the same, giving 
KBLLOC within the files, the contents of the word in NAME1 
NAME2, and the contents in NAME3 NAME4. If the end cf file 
is reached in one of the files, 'EOF* is printed in the 
rolunn for that file, and the remainder of the other file is 
listed. 



(END) 



»- x:> ^ t ts Kj\3 n a n nc* n • a vju i. u c 



.lJc; v^ ^a. vjit 



i T >£. Q 



Identification 

Convert 12-bit file to 6-bit 
12T0 6 



Pur£Ose 

To c:onvsEt a 12-bit file (e.g. $f$FIB OUTPUT) 
for offline processing via the disk eiitor. 



to 6-bit form 



Usaj^e 



12T06 HAME1 -NAME2- -NAME3- -NAWE4- 



File NAME! NAME2 will undergo the 12-bit to 6-bit mapping 
described for typewriter input in section AC.2.01; the 
r?!sulting file is MABE3 NAMEU. A single space is prefixed 
to each line of the output file to serve as carriage control 
for tha disk editar. 

IE NAME2 is omitted, it is assumed • (nEMO)»; if NAKE3 is 
omitted, it is assumed the same as NAHEl; if NAMEU is 
omittad, it is assumed •£€!)'. 



(END) 



CTSS tfiCuKAnilCH'b tiUiUB section aj.o.u^: a/oD 

13 a n tif ic a ti on 

Search a saved file 
SRCH SAVED 
N. I. Morris 

Purpose 

To search a SAVED file fcr a specific word. 



Usa_ge 



E SaCH NAME! LWOBD RWOBD LHASK RMASK 



NAME! SAVED is the name of the file to be examined. LWORD 

and BWORD are the left and right halves of the word being 
S3arch3d for- LMASK and RMASK are the left and right halves 
of a mask used tc ccntrcl the search. If no Bask is 

specified, a mask of 777777 777777 is assumed. 

The file specified is loaded into core from the disk. Then 
^ach word of the loaded core image is compared against the 
word specified in LWORD and RWORD with only those bits 
jutrespuadiug to 1 bits in the mask being compared. All 

occurrences of the word being searched for result in the 
printing of the absolute location of the word followed by 
the word itself. If no occurrence of the word is found, a 
massage to that effect will be printed. After the search is 
completed, the program will go to DORMNT. To resume another 
search on the same file, type: 

START LUOBD RVOBD LHASK BHASK 

To finish a search, and continue a chain of commands, type 
•START* followed by a carriage return. 

Example: 

To search the file 'PADBCD SAVED* for all LDQ instructions, 
type : 

R SRCH PADBCD 056000 777700 

Not2 that preceding zeroes may be omitted. 



(END) 






Identification 

Sanarate dump of SAVED file for off-line printing 

DUMPER 

D. Widrig 

Pucfiosa 

DUHPER can be used to generate dump files suitable for 
off-lina printing. Camplete machine conditions preserved in 
the SAVED files can be obtained. 

Usac|e 

R DUMEER MAMEl -• (CORE) •--• (TEMP) ' - -'(P8NT)'- 

Th3 machine conditions contained within NAME1 SAVED are 
re- formatted and written into a file called NAMEl (DUMP). 
If tha optional argument • (CORE)' is used, a complete 
Fns-like dump is alsc written into NAMEl (DUMP). Each word 
in the core dump will be interpreted as octal, BCD, and 
operation code. If the optional argument * (TEMP) * is used, 
NAMEl (DUMP) will be created in temporary mode. If the 

optional argument '(FRNr)' is used, a suisitary of the saved 
file's machine ccnditicns will be printed on the user's 
-onsola, in addition to the other activities. 

Timing 

If the '(CORE)' argument is not used, the creation of NAMEl 
(DUMP) takes 1.5 - 2-0 seconds and produces a 2- record file. 
If the '(CORE)' argunent is used, an X-record SATED file 
produces a 6X-rec3rd (CUHP) file taking .5 - .8 seconds per 
record of SAVED file. 



(END) 






I^sntijication 

Check success of RUNCOM 
QUES SAVED 
C. Gar man 

Purnose 

Way ba used to check success of commands in a •RUNCOM' 

Usaje 

R QU£S ALPHA BETA 

CUES will check to see if file » ALPHA BETA' exists. 
If it does exist, the chain will be continued 
iffloediately , without further ado. If 'ALPHA BETA' 
does not exist, progran will print: 

'FILE ALPHA BETA MOT FOUND.' 

•EC YCU WISH TO PROCEED, 
and will wait for input. An explicit 'YES' will 
cause program to continue the chain via a call to 
•CHNCOM'. Anything else will case the program to 
abort the chain and return to the systeai via 'DEAD". 



R QUES ALPHA 

is the saae as 'fi QUES ALPHA ESS' 



B QUES 



will cause program to pause unequivocally with 'DO 
YOU WISH 10 PROCEED,' (same conditions on reply as 
before) . 



R QUES ALPHA BETA (MOT) 

For protecting against the deletion of files, the 
appearance of a third argument, '(NOT) ', reverses 
the sense of the question, ie. if 'ALPHA BETA' is 
not found, the chain will be continued immediately, 
with no typed response. If the file exists, the 
program will print: 

•FILE ALPHA BETA ALREADY EXISTS... DO YCU WISH 
TO PROCEED,'. Waiting for a response (as above). 
Naturally, if 'BETA' is to be 'BSS', it must be 
stated explicitly. 



N3TE 



If QUES is used within a RUNCOM, and the question is 
not answered in the affirmative, files of the forn 
'...liMN SAVEC may still remain in user's file 
directory, as would be the case in any other break 
in the RUNCOM chain. 



(END) 






Parauetar identification within BUNCOM 
RUNP8T SAVED 
C. Sacman 

PucDgse 

IE it is desirable to print a comment line which identifies 
tha substituted parameters within a RUNCOM, RONPHT may be 
used. It prints the contents of the current command buffer 
with axcess blanks deleted. 

Usa^e 

RESUME RUNPRI- ABG1 ... AHGn 

HUNPBT will type one single line of text on the 
user*s console, of the form 

$ &RG 1 ARG2 ... ARGn$ 

where all blanks in the parameters ARGi ha we 
been removed, and a single blank inserted 
between successive ARGi. ARGi may be any 
words to be used in constructing the comment 
and any (or none) of the ARGi may be 
sustitutable arguments within te 80WCCW. 

Restrictions: 

The full connand buffer may be used, but only 14 words will 
be printed after conversion of the input parameters into the 
output image (null characters are not used in formatting the 
output line). Only the last six characters of any parameter 
will be printed. 

Example: 

Consider the following fiUMCOM, in file X BCD: 

CHAIH ALPHA HAD 

RESUME RUNPRT START »X» FOR ALPHA MAD 

HAD ALPHA (LIST) 

The command 

BOHCOfl X BOOK PAP 

would result in the following output on the user's console: 



CTSS PHOGRA«ME«'S SUIDE Saction AJ.i0.03 11/65 2 



Y SIARTED 

$ srAFf 'X' FOR BOOK FAP 

LENGTH nnnnn 

x'has been run 



(END) 



f-TQS! DRnCRA MMRR I <; rinTHR Sp>r! ti on A.I. 11.01 H/fiS 



Slave consoles 
SLAVE SAVED 
N. I. Morris 

Purpose 

To attach one or mDre remote consoles to serve as I/O 
devices for a user. 

Usage 

8 SLAVE MODE ID 1 ID2 ... IDN 

MODE consists of an j combination of the slave modes 
discussed in section AG, 1.05. MODE may also 
be 'BELEAS* in order to release consoles that 
are already slaved. 

IDI ... IDN are the console identification nuiabers of the 
consoles to be attached or released. 

Ex3c ution 

The console (s) specified are slaved to the user in the mode 
specified. If BODE was •RELEAS», the consoles are released 
from the user. 



(END) 



GUIDE Section AK.O 12-'59 



I d e n t i f i c a t i en 

Simpla programs 

Purjgose 

This saction of the CTSS Progr amoier* s Guide will be devoted 
to sample pccgranis illustrating techniques for using some of 
the more obscure facilities provided by the systen. 

Source files for these programs will be found in the CISS 
annual directory (B1U16 3212), and will be naoaed by the 
section number in which they appear, e.g. the sample 
subsystam described ia section AK.8.01 will be available as 
&K801 MAD, just as the manual section itself is AK801 ASCII. 

disclaimer 

Although the programs descrited herein have in general been 
tested and found to work, no guarantees are made concerning 
thair correctness, and time-tack credit requests involving 
attempts to use them cannot be honored. 



(EMD) 






I d e n t jj f i c a t i c n 

Usage of subsystem facility: sample program 



Puri>osa 

Allow a user to edit, compile, print and load programs, and 

to logout; prohibit any other non-exempt coamands. Give the 

user the option to restart his program if a saved file was 
^raatad . 



Proa_ram 

R SAMPLE PROGBAM TO USE SUBSYSTEM FACILITY 

B 
DIMENSION 3OWMND{20), MH0(1) 
NORMAL MODE IS INIEGEE 
E 
R 
START GETSYS. (NAME, MASK) 

CODE - (MASK .RS. IB) ,A. 777 « 
F 
WHENEVER CODE .E, 00 IK 
GCLS. (COHMHD, 0) 

THRODGH LOOKUP, FOB 1 = 0, 1, COBTBL(I) .E . FBHCE 
WHENEVER COMMND (0) .E, CCRTBL(I) 
RSOPT. (aOK) 

NCOM. (COMMND (0) , COMMND (1)) 
END OF CONDITIONAL 
LOOKUP CONTINUE 

FHMESS. (BZ57- (COMMND (0)), $ IS NOT A LEGAL COMMAND. $) 
TRANSFER TO CKSAVE 
OP WHENEVER CODE . E. 002K 

TRANSFER lO CKSAVE 
CE WHENEVER CODE .E. GOU K 

TRANSFER TO WAIT 
OR WHENEVER CODE .E . 010K 

EBMBSA, ($ERR08 $, 406057575757K) 
TRANSFER TO CKSAVE 
OB WHfNEVEK CODE .NE. 

PRMESS. (JDNKNOBN SUBSYSTEM TRAE CODE. $) 
END OF CONDITIONAL 
R 
WAIT SETSYS. (SAME, MASK .A. 017017K) 

DORMNT. 

TRANSFER 10 START 
R 
CKSAVE WHENEVER MASK .L. 

WHOAHI. (HR0(1)...2) 

F STATE. (WHO, $ SAVED*, SIZE...1, WAIT) 



CTSS EFCGBAMMER'5 GUIDE Section AK.8.01 12/69 2 



WHENEVER SIZE . I, 0, TRANSFER TO WAIT 

PRMESA. ($D0 YOU WANT TC RESTART YOUR PROGRAM... $) 
PDFLX A. (REPLY. ,. 1) 

WHENEVER REPLY .RS. 30 .E. |00000Y$ 
RSOPT. (40K) 
NCOM. (JCOHIINf, WHO) 
END OF CONDITIONAL 
END OF CONDinONAL 
TRANSFER 10 WAIT 
R 

D 

VECTOR VALUES COBTBL = i EDL$, $ PRINTS, * BADS, 

1 $LOADGO$, $LOGO0T$, 777777777777 K 
VECTOR VALUES FENCE = 777777777777K 

R 
END OF PROGRAM 



(END)